I'm kinda a newbie to ubuntu (only been using it for about 6 months) and I love it! I have been trying to get used to the terminal interface and I use it for a lot of things relating to securing my computer (firewalls, and stuff like that) and so as I try and work on improving my terminal skills I have also been trying to move away from the GUIs. I want to know if there is a command were I can get all the information listed in the User Accounts GUI (for example account type, password options, automatic login etc) in terminal.
2 Answers
The best way to find out information about users is through /etc/passwd
and /etc/group
files.
For instance awk -F : '!/nobody/ && $3>1000 {print $1}'
will tell you all the human users on the system and cat /etc/group |grep sudo
will tell you who has sudo privilleges
Automatic login is generally configured in /etc/lightdm/lightdm.conf
There is also /var/lib/AccountsService/users
folder where you can find some minor information on users who use graphical login. For instance, here is mine
[com.canonical.indicator.sound.AccountsService]
PlayerName=''
Timestamp=0
Title=''
Artist=''
Album=''
ArtUrl=''
PlayerIcon=<('themed', <['application-default-icon', 'application-default', 'application']>)>
[User]
Language=en_US
FormatsLocale=en_US.UTF-8
XSession=gnome
Background=/usr/share/backgrounds/LOGIN-WARNING.png
Icon=/usr/share/pixmaps/faces/penguin.jpg
SystemAccount=false
[InputSource0]
xkb=us
[InputSource1]
xkb=ru
[InputSource2]
ibus=sunpinyin
[InputSource3]
ibus=libpinyin
There is also file /etc/shadow.
To list the currently logged-on users, type who
.
To identify the current user, type whoami
.