connecting to amazon aws linux server by ssh on mac

后端 未结 5 1036
走了就别回头了
走了就别回头了 2021-01-30 02:37

I created a new keypair and downloaded it to my mac, then set up a new Amazon Linux AMI server with that keypair and my security group. Now I need to put the keypair .pem file t

5条回答
  •  灰色年华
    2021-01-30 02:54

    You'll want to put the keypair in {your home directory}/.ssh . If that folder doesn't exist, create it. Once you put the keypair in there you have to change the permissions on the file so only your user can read it. Launch the terminal and type

    chmod 600 $HOME/.ssh/
    

    That limits access to the file, and then to limit access to the folder type

    chmod 700 $HOME/.ssh
    

    You have to limit the access because the OpenSSH protocol won't let you use a key that other's can view.

    Then to log into your instance, from the terminal you would enter

    ssh -i /.ssh/ ec2-user@

提交回复
热议问题