Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't SSH as root into EC2 server - Please login as the user "ubuntu" rather than the user "root" [closed]

Tags:

I am trying to SSH into my server via WinSCP, although the problem will occur with putty as well.

I have Ubuntu 12.04 I have edited /etc/ssh/sshd_config and added PermitRootLogin without-password to the bottom of the file. But this still doesn't seem to have changed my problem.

People have mentioned needed to restart ssh demon. I have tried:

 /etc/init.d/sshd reload  reload sshd.service  /etc/init.d/sshd reload 

All of the above are unrecognised.

I have then tried Files ¬ Custom Commands ¬ sudo -s & su No luck there either.

like image 725
Jamie Hutber Avatar asked Mar 30 '13 19:03

Jamie Hutber


1 Answers

http://alestic.com/2009/04/ubuntu-ec2-sudo-ssh-rsync describes all the options available to you, and includes instructions for enabling SSH to root on EC2:

ssh -i KEYPAIR.pem ubuntu@HOSTNAME   'sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/' 
like image 72
nneonneo Avatar answered Sep 19 '22 09:09

nneonneo