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

42,999

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/'
Share:
42,999
Jamie Hutber
Author by

Jamie Hutber

I'm just trying to learn and then eat some food.

Updated on July 10, 2022

Comments

  • Jamie Hutber
    Jamie Hutber almost 2 years

    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.