1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【2024年版】Xserver VPSにMacのターミナルからSSH接続

Posted at

Xserver VPSを契約し、ターミナルからSHH接続をしようとしましたが
ネットで調べても古い情報しかなくうまくいかず苦戦したのでメモを残します。

STEP.1

まずは、VPSパネル画面に行き、パケットフィルターか設定から"パケットフィルター設定を追加する"を押して"SSH TCP22"を追加します。

(参考)
https://vps.xserver.ne.jp/support/faq/vps_ssh_timeout.php

vpsパケット.png

STEP.2

ssh Keyの権限を変更します。(適切な権限でなければエラーが出るため接続できません)
以下のコマンドをローカルのターミナルで実行します。

chmod 600 ~/.ssh/(sshキーファイルの名前).pem

STEP.3

以下のコマンドで、SSH接続を実行します。

ssh -i ~/.ssh/(sshキーファイルの名前).pem root@IPアドレス

(ex.)
ssh -i ~/.ssh/example.pem root@123.45.67.89

以上で完了です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?