建立免費Oracle Cloud 伺服器

Hello World
Mar 25, 2021

第一篇已經講咗怎樣建立Oracle Cloud 帳號, 現在建立免費Oracle Cloud 伺服器

登入 https://www.oracle.com/hk/cloud/free/

選擇Sign in to Oracle Cloud
打返你建立時輸入的 Cloud Account Name
之後 Continue
入你的電郵和密碼就可以了
進入到Oracle 頁面後,選Create a VM instance
先入你自己的VM 名
跟住到Image and Shape, 因為小弟係Ubuntu 愛好者, 所以我會係啲到改用Ubuntu, Click EDIT
Change Image
右邊有Windows 彈出, 選Platform Image, Click Canonical Ubuntu 20.04 , 之後Select Image 就可以了.

你會見到有啲選項係Always Free Eligible, 即係永久免費!

到SSH了, 這個和登入電郵和密碼一樣重要, 是身份認證. 一般預設就可以. 選Generate SSH Key pair -> Save Private Key 就可以. 請必須好好<<保存>><<保存>><保存>>(重要的講三次).
按下Create 就開始建立了
建好後就可以在 Compute -> Instances 內找到你的伺服器
這時候你會看到新建的伺服器準備就緒

接下來就要設定防火牆.

點選你的伺服器名稱
係Primary VNIC 下面, 點選你的Subnet
點選SSecurity Lists 內的Default Security list for …….
這個就是你的防火牆

用來控制伺服器的SSH 預設係用 TCP port 22 的. 你必須把這個Port在防火牆打開! (因為這只是一個為VPN 設定的伺服器, 一般設定就可以了. 如果要更進一步的話, 建議把SSH Port 更改, 防止有心人攻擊進入)

驗查這個 port 22 有無開啟

Source CIDR 0.0.0.0/0 代表任何IP
IP Protocol 必須是 TCP
DESTINATION PORT RANGE 必須是 22

伺服器設定完成. 可以用SSH 登入.

先Compute -> Instances 內找到你的伺服器記下你的Public IP Address

然後安裝一個SSH 的登入軟件, 比較推薦用Chrome web store 內的 Secure Shell

https://chrome.google.com/webstore/detail/secure-shell/iodihamcpbpeioajjeobimgagajmlibd
安裝後在Chrome 右上角打開Extensions 就可以找到

第一行是你對這個Profile 的Remark
Default Username:
ubuntu
YourServerIPAddress 你剛記下的Public IP Address
Port 22
Identity 就是你建立伺服器時, 要下載的那個Private Key, 你可以按import 後點選確認滙入. 那個Private Key就會在pull down Menu 內出現, 然後選擇就可以了.
完成後按Connect

回應 yes

第一次連線會出這個畫面, 這是確証你的伺服器連線和交換配對碼!
正常情況下只會出一次, 如果日後再出現這個畫面, 只有幾個可能,
一, 你的SSH 有重新安裝.
二, 伺服器IP 轉被換了.
三, SSH 交換配對的檔案有人搞過或重置過!
四, 你的SSH 連線中間有第三者在偷窺

如果出理這個, 就是連線不成功. 驗查下個IP 是否正確, user name, port, SSH Private Key. ORACLE 內旳防火牆PORT 22 有否開啟. 伺服器的Status 是否running.
這是成功登入的畫面

第一個要學識的Ubuntu command

sudo apt update && sudo apt upgrade

sudo = root 最大權限
apt update = 更新軟件數據庫
&& = 同理
apt upgrade = 更新軟件

更新完成
exit = 離開

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Hello World
Hello World

No responses yet

Write a response