--- lang: ja-jp breaks: true --- # Azure Visual Studio Code から プライベートキーファイルを指定したSSH接続 2021-05-06 > https://code.visualstudio.com/docs/remote/ssh-tutorial ## 環境 #### Visual Studio Code  #### Remote - SSH  #### Azure Virtual Machines ```shell= $ uname -a Linux XXXXXXXX 5.4.0-1046-azure #48~18.04.1-Ubuntu SMP Tue Apr 13 19:41:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux ``` ## コマンドパレットより、「Remote:SSH Config File」を設定する。  ※パスの区切り文字を"\\\\"として設定すること。  ## Azureからダウンロードしたプライベートキーファイルを、「C:\\Users\\[ユーザ名]\\.ssh\\~」に格納する。 ※「puttygen.exe」で変換したファイルはフォーマットが不正とのエラーが出るので、変換する前のファイルを使用する事。 ## プライベートキーファイルの権限を変更する。 ※Visual Studio Codeを利用するユーザにフルコントロールを与え、それ以外のユーザは全て削除すること。余計なユーザが残っているとエラーとなる。  ## ~\\.ssh\\config の設定  ※「C:\\Users\\[ユーザ名]\\.ssh\\config」を選択する。  ```shell= # Read more about SSH config files: https://linux.die.net/man/5/ssh_config Host AzureDbServer HostName [ip_address] User [ssh username] IdentityFile "C:\Users\[username]\.ssh\DBServer_key.pem" ``` ## 以上の設定でSSH接続が可能となる。  ###### tags: `Azure` `Visual Studio Code` `SSH` `Azure Virtual Machines`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up