My last post was about adding users from SAM GUI tool. This is about adding a user from command line tool useradd.
Create / add a user call rocky with home directory
Setup a password for rocky
Remember password must be 6 chracter long and include special character and digits for security.
Add user john to secondary group called accounting
Code:
useradd -G accounting -m john
passwd john
Final example
=> Add a user called guestuser as per following requirements
=> Primary group member of guests
=> Secondary group member of www and accounting
=> Shell must be /usr/bin/bash3
=> Home directory must be /home/guestuser
Code:
useradd -g guests -G www,accounting -d /home/guests -s /home/guestuser/ -m guestuser
passwd guestuser
Read man page for more info and options
Code:
man useradd
man passwd