1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【EC2】インスタンスへのssh接続

Posted at

sshとは

スクリーンショット 2020-08-02 15.46.55.png 「**Secure Shell**」の略で、リモートコンピュータと通信するためのプロトコル パスワードなどの認証部分を含むすべてのネットワーク上の通信が暗号化される
sshコマンドの基本書式
$ ssh [オプション] ホスト名 [コマンド]

1. EC2インスタンスに設定した秘密鍵をsshフォルダに移動する

$ mv ~/Downloads/[秘密鍵名].pem ~/.ssh

2. 秘密鍵の権限を変更する

$ chmod 400 ~/.ssh/[秘密鍵名].pem

3. ssh接続する

$ ssh -i ~/.ssh/[秘密鍵名].pem ec2-user@[パブリックIP]

接続完了

The authenticity of host 'xx.xxx.xxx.xx (xx.xxx.xxx.xx)' can't be established.
ECDSA key fingerprint is SHA256:DGjzULHBFqLHFfqog1gMgytJvzi9ByO05xa70+MxAik.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'xx.xxx.xxx.xx' (ECDSA) to the list of known hosts.

       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-ami/2018.03-release-notes/
5 package(s) needed for security, out of 6 available
Run "sudo yum update" to apply all updates.
1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?