user administraton - acavataio/ITC-136 GitHub Wiki

  1. Who has logged in? (via ssh and via the terminal)
    who -a (--all)

  2. Who is currently logged in?
    who -u (--users)

  3. Disable a user?
    sudo passwd -l username (-u to enable)

  4. Log a user out of your machine without disabling their account
    pkill -KILL -u username

  5. Remove a user from the system along with their home dir
    deluser --remove-home username

  6. Stop all processes run by a user
    killall -u (--user) username

  7. If you wanted a file to be automatically copied to the home dir of every new user you create, where would you put it?
    -become root
    -cd /etc/skel
    -ls -la
    put the file in there to copy to home directory of every new user logging in.

  8. If you wanted a script to execute each time a user logged in, where would you put it?
    -cd /etc/skel

  • vim .profile
  • add
  • cat (filename)