Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello. Since a few days I am not able to login using SSH as root user, and I really do not know what is the issue. All I can do is log in as an other user and then su to root. My OS is Debian x64, and I've already tried reinstalling whole open-ssh package.
Here's the auth log:
Code:
Apr 13 00:49:18 ns237710 sshd[20880]: Accepted password for root from xxxxxxx port 65170 ssh2
Apr 13 00:49:18 ns237710 sshd[20880]: pam_unix(sshd:session): session opened for user root by (uid=0)
Apr 13 00:49:18 ns237710 systemd-logind[4994]: New session c137 of user root.
Apr 13 00:49:18 ns237710 sshd[20880]: pam_systemd(sshd:session): Failed to stat runtime dir: No such file or directory
Apr 13 00:49:18 ns237710 systemd-logind[4994]: Removed session c137.
As I said i reinstalled the whole package, so the config in /etc/ssh is fresh and unchanged.
Nope, it just happened. I have no idea what is wrong with this.
What unSpawn said. Account root is for local administration only, root does not use any applications, root does not initiate remote logins. It is often called root user and it is incorrect, root is not user.
There is an sshd setting /etc/ssh/sshd_config... append.
Code:
PermitRootLogin no
AllowGroups wheel sshusers
In your sudoers file you should have...
Code:
%wheel ALL=(ALL) ALL
Create the group sshusers.
Code:
groupadd sshusers
You can add users to either group using the following command where $USER=="myuser".
Code:
usermod -a -G wheel myuser
Now only users who belong to the group "wheel" or "sshusers" can actually log in using SSH. Only users who are in the wheel group can log into root using sudo. The sshusers group is for non-root privileged users to gain SSH access to the system. This is usually the first thing I do when setting up any system. I highly recommend you doing the same.
You can also learn more about the different options in sshd_config.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.