How do I log every command executed by a user?

Add this line to your pam config responsible for logins (its system-auth on redhat based distros) session required pam_tty_audit.so enable=* To find out what was done, you can use. ausearch -ts <some_timestamp> -m tty -i This produces an output like this: type=TTY msg=audit(11/30/2011 15:38:39.178:12763684) : tty pid=32377 uid=root auid=matthew major=136 minor=2 comm=bash data=<up>,<ret> The only … Read more

How do I access the list of currently logged on users through Terminal Services Manager in Windows Server 2012?

Yep, tsadmin is gone. Kinda’ sucks. There’s RDMS through Server Manager and the Remote Desktop Powershell cmdlets (get-command *RD*), but those both require that a full Remote Desktop Services deployment exist on that server. Those don’t work on servers without RDS deployments or on workstations. You can use Task Manager… or, if you want something … Read more

How do I create user accounts from the Terminal in Mac OS X 10.5?

Use the dscl command. This example would create the user “luser”, like so: dscl . -create /Users/luser dscl . -create /Users/luser UserShell /bin/bash dscl . -create /Users/luser RealName “Lucius Q. User” dscl . -create /Users/luser UniqueID “1010” dscl . -create /Users/luser PrimaryGroupID 80 dscl . -create /Users/luser NFSHomeDirectory /Users/luser You can then use passwd to … Read more

How can I rename a Unix user?

Under Linux, the usermod command changes user names. It modifies the system account files to reflect the changes that are specified on the command line. To change just the username: usermod –login new_username old_username To change the username and home directory name: usermod –login new_username –move-home –home path_to_the_new_home_dir old_username You may also want to change … Read more

What’s the default superuser username/password for postgres after a new install?

CAUTION The answer about changing the UNIX password for “postgres” through “$ sudo passwd postgres” is not preferred, and can even be DANGEROUS! This is why: By default, the UNIX account “postgres” is locked, which means it cannot be logged in using a password. If you use “sudo passwd postgres”, the account is immediately unlocked. … Read more