User Tools

Site Tools


User Management

Create a user with useradd

The following command creates the user “ftpexample” with the following attributes:

username ftpexample
group example
home directory /home/www/sta/example/
comment / name example SA - Marcel Muster
shell no shell access (ftp only)

Create a group for the user ftpexample first (if the group doesn't exist yet):

groupadd example

Create the user with all options from above:

useradd -d /home/www/sta/example/ -c "example SA - Marcel Muster" -G example -s /sbin/nologin ftpexample
If you want prevent the users from login (ftp only) set the shell to /sbin/nologin.

Set a password for the user

Generate a password:

cat /dev/urandom | strings -n 8 | head -5

Set the password:

passwd ftpexample

Add the user to a new group

usermod -a -G newgroup ftpexample

Change primary group of a user

usermod -g newgroup ftpexample
/srv/ · Last modified: 2011/07/19 16:46 (external edit)