iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 8
0
Microsoft Azure

飛上雲端-Azure系列 第 8

建立虛擬機器 (5)-SSH

  • 分享至 

  • twitterImage
  •  

按下建立後,即會跳轉至此畫面。
https://ithelp.ithome.com.tw/upload/images/20200923/20130663CzB5TFCv8c.png

部署完成後,即可點擊你的虛擬機名稱,進入其概觀頁籤,並確認設定是否無誤。
https://ithelp.ithome.com.tw/upload/images/20200923/20130663K3c6nGgLph.png

以上都沒問題的話,我們還需要透過某些工具及設定以連接到虛擬機器。
https://ithelp.ithome.com.tw/upload/images/20200923/20130663gXIstgEjKQ.png

點選連接下的SSH會跳轉到連線SSH,除了PuTTY,我習慣使用Visual Studio Code的Remote - SSH extension。
https://ithelp.ithome.com.tw/upload/images/20200923/201306630gVIVWEGhB.png

安裝完成並reload VS code後,可以點擊左下角的遠端圖示以開啟遠端視窗。
https://ithelp.ithome.com.tw/upload/images/20200923/201306637WLERzT97V.png

點選Remote - SSH: Connect to Host... - Add New SSH Host
https://ithelp.ithome.com.tw/upload/images/20200923/20130663OY3njuMK9D.png

並輸入建立虛擬機器時的使用者名稱@ip,並選擇SSH連接config檔案的儲存位置。
https://ithelp.ithome.com.tw/upload/images/20200923/20130663ac0zDwfdZy.png

若在建立虛擬機器時選擇SSH金鑰而非密碼,則指令應加上-i指令以指定SSH金鑰檔案位置。

ssh -i <私密金鑰路徑> 使用者名稱@ip

而若ip位置未指定為一靜態ip,可以設定DNS域名,讓Azure隨時更新以將動態ip位址與此域名連接。
https://ithelp.ithome.com.tw/upload/images/20200923/20130663XfrW2kJZTp.jpg

接著按下右下角提示視窗的Connect
https://ithelp.ithome.com.tw/upload/images/20200923/20130663q6yzQ6Id0O.png

等待Setting up SSH Host: Initializing VS Code Server完成後
https://ithelp.ithome.com.tw/upload/images/20200923/20130663JFTDJ3ylM5.png

選擇你的虛擬機器的作業系統。
https://ithelp.ithome.com.tw/upload/images/20200923/201306639VSWO8xs4Z.png

並輸入密碼。
https://ithelp.ithome.com.tw/upload/images/20200923/20130663YBjG3uVqtU.png

即可成功連接。
https://ithelp.ithome.com.tw/upload/images/20200923/201306631lngOpDLpR.png


上一篇
建立虛擬機器 (4)-管理、進階、標籤、檢閱+建立
下一篇
網頁伺服器-安裝伺服器及套件
系列文
飛上雲端-Azure30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言