Changes needed to allow root login require root access

I’ve been looking at the wiki page “Root Login”, but it hasn’t been helping me. I’ve tried everything on there, but all of the steps I’ve tried have required root access:

-Editing the sshd_config file to allow root access requires root access to edit
-Moving files from one directory to another requires root access
-Installing sudo requires root access

I really don’t know what else to try. What am I doing wrong or not seeing?

Usually you do not need (or want to allow) to log stright into root.

To access the root user you can to two things, common for both is that you log in with your “normal” user first (for turnkey this is most commonly the “mc” user).
After this you can:

  1. Run a command as root:
    sudo command For example: sudo passwd root
    sudo tells the system that you wish to run the command you give after sudo as if it where the root user giving the command. It then asks for the password of the normal user. For the majority of cases this is enough.

  2. log further into the system as root from the “normal” user:
    This tells the system that you wish to log into the root user, and asks for the root users password. Anyting you do after successfully entering the root password is done as root. You might have to set a password for the root user, luckily I just gave you how to do that as an example above.

1 Like

From the Turnkey console, logged in as root, nano is available to edit the sshd_config file to allow root access via ssh/sftp.

Keep in mind you can brick your minecraft server by using it for things, for example: log in as root via sftp and in some cases just looking at a file with the view/edit function required a d/l to your pc then re-u/l to the server. in this case you could accidentally change the permissions of the file from mc to root, then it may not work properly.

So best practice is not to use it. if you do for example to u/l a forge.xx.jar file to the ‘profiles’ folder, then do that and only that, logging off as root then doing everything else as mc.

I think ‘root’ was removed for good reasons. some of those reasons become invalid if only on your home network. if you port fwd and allow the public in, better make changes to sshd_conf to ‘disallow root access’ again.

1 Like

I recommend not opening for root login directly via SSH, but keep the SUDO / SU method.