1

i want to login via ssh without password using root account. I have problem with /etc/ssh/sshd_config file. I set: PermitRootLogin without-password and StrctMode no but it doesn't work (i have to enter passphrase to key)

I have Ubuntu 16.04.

1 Answers1

0

First the option "PermitRootLogin without-password" does not do what you think it does. This option does not allow you to log in without a password, it allows you to log in as root via any method other then password authentication.

Typically this would be ssh keys, but could include other methods such as kerberos.

Second, I highly suggest you continue to login as root with a key with a password. If you do not want to enter a password every time, add it to ssh agent. On the command line this would be ssh-add ~/.ssh/key_name. This is a one time entry of your key password and subsequently you do not need to enter a password.

After the above command you can simply

ssh root@server

If you want a key without a password , make a new key with an empty password on the client machine.

ssh-keygen

When it asks you for a password, just hit the Enter key without entering a password.

I suggest you give it a name rather then using the default.

You transfer the key with ssh-copy-id (you will need to log in to the server as root with a password to transfer the key).

ssh-copy-id -i ~/.ssh/your_key.pub root@server

You can then ssh in without a password

ssh -i ~/.ssh/your_key root@server

Once the key is working, go ahead and disable password authentication again.

Panther
  • 104,528