0

I am trying to setup an Ubuntu server for the first time. I have followed this guide to install Ubuntu 18.04 within a virtual machine.

I then followed this guide to configure a static ip, which seems to have worked fine:

enter image description here

I am now trying to follow this guide to set the server up, however I am failing at step one logging in as root. I use ssh [email protected] and am prompted for the password and have entered the one I set during the installation, however that is not accepted.

I've assumed that this is the password I should be entering as I have not set any other password. Is this logic correct? Or what should I be entering here? Assuming I have done everything else correctly.

4
  • 1
    Password-based login for the root account is normally disabled - you should log in using the credentials you supplied in Step 19 Dec 14, 2018 at 16:28
  • Thanks @steeldriver, I login initially using those credentials. Now the guide I am following is saying to enter ssh root@your_server_ip, should the password required be the same as the password from step 19 or should I not be doing this at all?
    – Maverick
    Dec 14, 2018 at 18:02
  • The second guide that you linked appears to be specific to DigitalOcean droplets - these may be configured to use root out of the box. Vanilla Ubuntu doesn't do that. Dec 14, 2018 at 18:05
  • Okay, so I will need to use DigitalOcean droplets in order to follow that guide?
    – Maverick
    Dec 14, 2018 at 18:09

1 Answer 1

3

I don't think what you're trying to do is actually possible with a fresh install.

By default, the root account is accessed by sudo. Password for root is not set in Ubuntu which means the root login is disabled by default. This is good security practice to not permit remote logins to root on your system.

To login, leverage the username and password you provided during the install to login as that user, then sudo su - if you really want to run as root.

1
  • Even if a password is set for root (allowing local root login), the default sshd_config doesn't allow password-based authentication IIRC (it sets PermitRootLogin to prohibit-password) Dec 14, 2018 at 16:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .