26

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.

11
  • 6
    This is a problem for da-da-da-dah! superuser(.com)! Mar 30, 2013 at 20:02
  • using private keys ;) Mar 30, 2013 at 20:02
  • @statueuphemism I thought so, but i saw another problem almost identical on here... :O Mar 30, 2013 at 20:02
  • Okay with keys no topic. Do you have a line like AllowUsers ububtu
    – rekire
    Mar 30, 2013 at 20:04
  • inside of sshd_config? no i don't Mar 30, 2013 at 20:05

1 Answer 1

64

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/'
10
  • 9
    For the record, current Ubuntu 14.04 LTS AMI's have the same authorized_keys in /root/.ssh and /home/ubuntu. However, trying to log in with root yields Please login as the user "ubuntu" rather than the user "root". I haven't found how they're doing that yet.
    – Greg Bell
    Aug 30, 2015 at 21:56
  • 2
    Yep, but it's not ~/.profile, ~/.bashrc or /etc/profile doing it... Nor is it limited by ~/.ssh/authorized_keys or ForceCommand in /etc/ssh/sshd_config
    – Greg Bell
    Sep 1, 2015 at 8:09
  • 5
    Check /root/.ssh/authorized_keys :)
    – nneonneo
    Sep 1, 2015 at 15:55
  • 1
    Not there either. Nor /root/.bashrc etc.
    – Greg Bell
    Sep 2, 2015 at 21:58
  • 4
    @GregBell Look in /root/.ssh/authorized_keys you can disable it there. Sep 15, 2016 at 14:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.