How to Create User with useradd in FreeBSD
You can invoke “adduser” command in FreeBSD in order to create new user. Adduser will prompt you for user info like name, uid, gid, shell environment and etc. But sometime we would like to create user access through Bash script. “useradd” command is the good way to do it.
In Linux, using “useradd” is pretty common for creating new user access. You can also use “useradd” in FreeBSD, but not directly invoke “useradd” command. Below is the sample of creating new user in FreeBSD with “useradd”.
shell> pw useradd cheryl -c 'Cheryl Windows Admin' -d /home/cheryl -s /usr/local/bin/bash
New user account is created, but don’t forgot to set password for the account
shell> passwd cheryl
You can run other command like “userdel”, “usermod”, “usershow”, “groupadd”, “groupdel”, “groupmod”, “lock”, “unlock” on FreeBSD by using the “pw” command.
Related posts:
- Change or Set User Password in FreeBSD If you notice, during FreeBSD installation, it doesn’t have a...
- Create Root Privilege User on MySQL By default, MySQL root privileges user is “root”, I always...
- How to Change User’s Shell Environment in FreeBSD In FreeBSD, user’s default shell environment is either sh or...
- Reset MySQL Root Password Very often, once we didn’t log on to MySQL database...
- installing postgresql 8.2 on Leopard with macports postgresql! one of my favorite high performance open source db,...
- MySQL Quick Installation on FreeBSD Quick installation of MySQL Database on FreeBSD Server. Make sure...
- What is umask? umask? What? What is umask command use for in linux/unix...
- Enable SSHD on FreeBSD I believe most system admin does remote access to the...
- Bash: How to Echo Tab and Newline While printing out result in bash, sometime we need to...
- How to Change Hostname in Unix FreeBSD We have interesting hostname for our all our servers. Some...
Tags: adduser, freebsd, groupadd, groupdel, linux, lock, pw, systems, unix, unlock, useradd, userdel