Solved

user login allowed in ubuntu

Posted on 2012-03-17
4
339 Views
Last Modified: 2012-06-27
In Ubuntu, How can I check which users has the rights to login allowed ?

Can I see it in the passwd file?

The question is how can I see if a user account has the right to login in the usual login page

Thanks
0
Comment
Question by:lnrivera
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 500 total points
ID: 37733742
You can do a number of checks.  See /etc/shadow file and see which users have a password hash without  a leading !.

Get the list of those users and run the following command

chage -l userID
The above option is lower case L.
Also, see if the user has a valid login shell.  If he doesn't, it would keep logging him through command line login.
0
 
LVL 28

Expert Comment

by:serialband
ID: 37735886
If the users users ssh keys, then the leading ! in /etc/shadow doesn't actually lock them out from remote access.  It only blocks password access.  A fully locked out user has both the leading ! and an invalid login shell, or just a commented out password entry.
0
 
LVL 5

Expert Comment

by:1ly4me
ID: 37736892
Yes, /etc/passwd file gives you access right for every user unless the users are allowed through SSH authorization.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 37737253
Even SSH relies on /etc/passwd and /etc/shadow mechanism except in case of ssh public/private key certificates in which case, it would bypass passwords completely.  But in this case there would be ~/.ssh/authorized_keys file with public part of certificates.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now