|
Creating New
Users on your Unix/Linux Server
This is accomplished with the "useradd" command. There are lots
of options that go along with the useradd command, but you'll only need
a few of them.
Here is the
functionality for Linux (RedHat 7.3 and most others)
and for Solaris (5.5.1, 5.7, and others)
useradd
function |
description |
| -u uid |
Add user with
specified user ID number |
| -g group, -G
group, ... |
make user part
of group (-G for multiple groups) |
| -m |
If user's homedir does
not exist already, create it |
| -d home |
make user with
specified home directory |
| -s shell |
set user's
default shell to specified option |
| username |
The username
you want |
If you don't specify any options
(for example, "useradd bob"), it will use the
default values: It will create a new uid (last uid +1) and group (groupname=username),
and will set the home directory to /home/user, using /etc/skel as the
template
directory, and /bin/bash as the default shell.
------- Code Sample 1
- Typical useradd -------
[root@server root] useradd -g webusers -m -d /users/a/aaron
-s /bin/csh aaron
(This will create user aaron, a member of group "webusers",
with home directory /users/a/aaron, and with shell /bin/csh) |
|