Thursday, August 21, 2008

Linux: Add User To A Group

First, if the group dose not exists, use the following command to add a group:

groupadd

For example, to add a group called mysql, use the following command:
#>groupadd mysql

To add a user with a group, use:
useradd -s -m -d -g UserName

For example, to add a use called mysql to a mysql group, using the following command:

#> useradd -s /bin/csh -m -d /home/mysql -c "Mysql User" -g mysql mysql


No comments: