LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-12-2014, 05:50 PM   #1
raquo
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Rep: Reputation: Disabled
Cann't login as root


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.
I would appreciate your help!
Thanks!
 
Old 04-12-2014, 06:35 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
in deducing any problem
step 1 is normally " what has changed" .
 
Old 04-13-2014, 06:05 AM   #3
raquo
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Nothing has changed. It happened after a reboot after over 60 days.
 
Old 04-13-2014, 11:02 AM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
nothing?
not even security updates ?
 
Old 04-13-2014, 11:04 AM   #5
anon112
Member
 
Registered: May 2008
Distribution: Arch, FreeBSD
Posts: 116

Rep: Reputation: 17
You may consider checking your settings in /etc/ssh to ensure that logging in as root is permitted, perhaps something has changed in there.
 
Old 04-13-2014, 05:13 PM   #6
raquo
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-13-2014, 05:41 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by raquo View Post
All I can do is log in as an other user and then su to root.
...which is what you should do in the first place as root should not be allowed to login over any network anyway.


Quote:
Originally Posted by raquo View Post
Code:
Apr 13 00:49:18 ns237710 sshd[20880]: pam_systemd(sshd:session): Failed to stat runtime dir: No such file or directory
What does 'ssh user@host echo $XDG_RUNTIME_DIR' return? (Should be /run/user/$UID IIGC.)
 
Old 04-13-2014, 06:30 PM   #8
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
Old 04-14-2014, 05:43 PM   #9
raquo
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yes, I know that root shouldn't be used, soon I will not do that anymore
@unSpawn http://screenshooter.net/2066175/vqpdqpx
 
Old 04-14-2014, 06:26 PM   #10
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
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.

Code:
man sshd_config
SAM
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Gnome: Cannot login as default user, sends back to login, works as root Danny-T Linux - Newbie 2 05-27-2006 03:44 AM
root account cann't login ringerxyz Linux - Newbie 7 02-02-2005 06:53 PM
Why cann't root modify the xinetd.d directory? gxie Linux - General 2 11-26-2003 03:33 PM
Cann't mount root fs during installation sensor Linux - Newbie 0 07-30-2003 11:49 AM
cann't a user other than root mount msdos formated floppy justjha Linux - Newbie 3 01-24-2001 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration