I need SSH access to an Amazon EC2 instance running Ubuntu 10.4. All I got is the amazon username and password. Any ideas?
相关问题
- Why doesn't php sleep work in the windows-subs
- JQ: Select when attribute value exists in a bash a
- Installing Pydev for Eclipse throws error
- Error building gcc 4.8.3 from source: libstdc++.so
- what's the role of libopenssl-ruby?
相关文章
- 为什么nfs在不同版本的Linux下安装的文件都不一样
- I cannot locate production log files on Elastic Be
- Incompatible JavaHl library loaded
- Python - Node.js (V8) runtime is not available on
- Ubuntu graphviz 'sfdp' not working
- AWS - Configuring access to EC2 instance from Bean
- Gearman , php extension problem : Class 'Gearm
- Decrease the tabs bar height in gnome terminal
I Accepted AWS offer to use the default security groups which included 'All Trafic' ports.
And, after many and many times trying to connect on my new ec2 instance, I just realized that I should edit my used security group and manually add to inbound and outbound the 22 port ( ssh ) !
Hope it helps !
STEP 1) Download private keys assigned to your ec2 machine (which is only one time download when created. so recommended to commit somewhere)
STEP 2) and fire following commands,
Official Doc : Connecting to Your Linux/Unix Instances Using SSH
Doing what is suggested in all these answers is not enough. Against each instance you see a security group. When you launch a new instance, you will have this thing set to default. You need to edit the security group and add the ssh port it. Later you need to add the 8080, 8443, 80, 443 ports also when you want to host your website.
First change permission of pem file by
Inside the file ~/.ssh/config add the following lines, at the top of the file
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
and enjoy it!
Note: To navigate into
.ssh
folder. First pressCtrl + H
in home folder to display all the hidden files and finallycd .ssh
Basically, you need a private-key file to login into your EC2 via SSH. Follow these steps to create one:
ssh -i /path/to/private-key root@<ec2-public-dns-address>
- the root username has been avoided in the latest releases, based on your distribution selectec2-user
orubuntu
as your username.To setup Ubuntu on AWS, please follow the following steps:
To access the instance via SSH, run:
Connect to Linux box by specifying your PEM file, e.g.
Make sure your PEM file has 600 permission (
chmod 600 file.pem
).Troubleshooting
If you're running VPC instance, and your security group is correct (with the right rules) and it still doesn't work, in VPC section check your subnet which should be attached to your VPC (both used by your instance) and setup new rule in Route Table that has
0.0.0.0/0
as Destination and your Internet Gateway as Target.For more details check: Troubleshooting Connecting to Your Instance
See also: Possible reasons for timeout when trying to access EC2 instance