Making a user account can use two different commands, namely
useradd and adduser. Here's an explanation of each command making
user:
useradd
Making a user account with useradd has its own rules about
how to add the uid, group, home directory, etc..
debian: ~ # useradd-u 510-d / home / tri-g test-s / bin / csh exercise
ket:
-u / uid = 510
-d / home / tri = / directory tri
group = test-g
-s / shell = / bin / csh
exercise = user
$ passwd exercise
adduser: adduser command usage is not much different from the command useradd.
To see what options are needed, use the following command
.
Example:
The authors want to create a new user account with the name latihan1, with
following provisions:
Having a home directory with the name `/ home / tri`
Being in the group `test`
Debian user UID 505
Using the shell `bash`
Using the password `exercise`
Solution:
first - first, the author will prepare the group with gid 503 and group tests
root@tri-laptop:/# groupadd -g 503 -r tes
root@tri-laptop:/# cat /etc/group
tri:x:1000:
sambashare:x:122:tri
winbindd_priv:x:123:
mysql:x:124:
bind:x:125:
tes:x:503:
then consider making exercise1 user under test group:
$ sudo adduser - home / home / tri - shell / bin / bash - uid 503 latihan1
$ sudo user group
ex:
$ sudo adduser test exercise1
Warning: The home dir / home / tri / you specified already exists.
Adding user `exercise1 '...
Adding new user `exercise1 '(505) with group` test' ...
The home directory `/ home / adi / 'already exists. Not copying from `/ etc / skel '.
adduser: Warning: The home directory `/ home / tri / 'does not belong to the user you are currently creating.
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for exercise1
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y / n] y
see the results that have been created using the command:
$ more / etc / group
mysql:x:124:
bind:x:125:
tes:x:503:exercise1
exercise1:x:501:
root@tri-laptop:/#
Implementasi User dan Group
No comments:
Post a Comment