[ubuntu-cloud] how to use root with winscp login?

Scott Moser smoser at ubuntu.com
Mon Aug 30 16:55:11 BST 2010


On Sat, 28 Aug 2010, Hu Houcun wrote:

> When I want use root account login from winscp , but can't login.
> before , I already use ubuntu login success , and done "sudo passwd root"
>
> But I use the root account login from putty and winscp still fail.
>
> How do I login ubuntu server 10.04 amazon ec2  from winscp and have all
> permisson ? or can use root account.

In order to allow root login to an instance, you will have to take one of
two routes:
a.) use ssh keys for root login
The key that you started the instance with (ie: from
ec2-run-instances --key MYKEY), should already be populated into the root
users' .ssh/authorized_keys.  So, if you do:
  ssh root at hostname
you will see a message like:
  Please login as the ubuntu user rather than root user.

That message comes because /root/.ssh/authorized_keys has a 'command' in
the given key's line.  To remove that command you can:

  sudo sed -i.bk 's,^command.*\(ssh-[dr]s[sa]\),\1,' /root/.ssh/authorized_keys

That will enable ssh access as root via ssh keys, which would be greatly
recommended over using passwords (as below).

b.) use password auth
Password authentication is disabled in the Ubuntu EC2 images by default.
If you wanted to enable it, you would need to
 1.) set a password for the user you want to log in as (as you said you
did)
 2.) enable password auth in ssh, by changing the following lines
in /etc/ssh/sshd_config .
  # Change to no to disable tunnelled clear text passwords
  #PasswordAuthentication yes
 3.) restart sshd
 sudo restart ssh


The above documents what you need to to do enable root ssh.  I have no
personal experience with winscp, but I would expect that one or both of
the options above to work.

Scott


More information about the Ubuntu-cloud mailing list