How do I set up SSH access for an Amazon EC2 instance?

后端 未结 13 1053
挽巷
挽巷 2021-01-29 19:20

I need SSH access to an Amazon EC2 instance running Ubuntu 10.4. All I have is the Amazon username and password. Any ideas?

13条回答
  •  鱼传尺愫
    2021-01-29 19:39

    First change permission of pem file by

    chmod 400 path/to/key_pair.pem
    

    Inside the file ~/.ssh/config add the following lines, at the top of the file

    Host AWS
         Hostname myserver.com
         User myuser
         IdentityFile path/to/.pem/file
         port 22
    

    Hostname take IP or link of server, User take username of server and Identity file is file downloaded from AWS when you created instance. Just Run the following command in terminal

    ssh AWS
    

    and enjoy it!

    Note: To navigate into .ssh folder. First press Ctrl + H in home folder to display all the hidden files and finally cd .ssh

提交回复
热议问题