users and groups

Setting Up Users and Groups

useradd -D – list all settings
useradd [Name of User] – Add user
passwd [Name of User] – Create Password
useradd -c “Full Name” [Name of User]

cat /etc/passwd – view user details
cat /etc/shadow – view user passwords

userdel -r [Name of User] – delete user
usermod -c “Full Name” [Name of User]

cat /etc/group
groupadd -r [Name of Group] – Added a group under 500
usermod -G [Name of Group] [Name of User] – ensure you add the user to all appropriate groups.
groups [Name of User] – list the groups the user is in

Change FTP password

cd /home
passwd username

List all FTP Users and Passwords

mysql -uadmin -p` cat /etc/psa/.psa.shadow` -Dpsa -e”SELECT REPLACE(sys_users.home,’/home/httpd/vhosts/’,”) AS domain, sys_users.login,accounts.password FROM sys_users LEFT JOIN accounts on ORDER BY sys_users.home ASC;”

List all Mail Users and Passwords on Server

mysql -uadmin -p` cat /etc/psa/.psa.shadow` -Dpsa -e”SELECT mail_name,name,password from mail LEFT JOIN domains on mail.dom_id = INNER JOIN accounts where mail.account_id =;”

List all MySQL Users and Logins

mysql -uadmin -p` cat /etc/psa/.psa.shadow` -Dpsa -e” SELECT AS domain_name, AS database_name, db_users.login, accounts.password FROM data_bases, db_users, domains, accounts WHERE data_bases.dom_id = AND db_users.db_id = AND db_users.account_id ORDER BY domain_name;”