Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I created a new user using useradd command.

I need the logs for it. Where it will be available.

Thanks in advance.

share|improve this question
    
what kind of logs are you looking for? –  Ankit Aug 28 '12 at 13:05
    
logs specifying that a new user has been created. –  batman Aug 28 '12 at 13:07
    
One way to chech if user has been created "cat /etc/passwd | grep <user>". And please try to use adduser command instead of useradd; if you're facing some issues. –  Ankit Aug 28 '12 at 13:17
add comment

1 Answer

up vote 6 down vote accepted

When you have created a new user look in /var/log/auth.log; the details are in there. I just created new user jim by running sudo adduser jim, for example, and this is at the end of auth.log (I have removed the date and host name from the start of the log):

 sudo: mike : TTY=pts/2 ; PWD=/home/mike ; USER=root ; COMMAND=/usr/sbin/adduser jim
 sudo: pam_unix(sudo:session): session opened for user root by mike(uid=1000)
 groupadd[1731]: group added to /etc/group: name=jim, GID=1001
 groupadd[1731]: group added to /etc/gshadow: name=jim
 groupadd[1731]: new group: name=jim, GID=1001
 useradd[1735]: new user: name=jim, UID=1001, GID=1001, home=/home/jim, shell=/bin/bash
 passwd[1742]: pam_unix(passwd:chauthtok): password changed for jim
 passwd[1742]: gkr-pam: couldn't update the login keyring password: no old password was entered chfn[1743]: changed user 'jim' information
 sudo: pam_unix(sudo:session): session closed for user root

This particular log is very useful as it records all use of elevated privileges such as creating a user, running Synaptic, etc, and also notes who has done it.

share|improve this answer
    
exactly what I was looking for. –  batman Aug 28 '12 at 14:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.