:: [linux] Adding/Deleting Users on RH 9.0 using command line options. ::
HOME


[Date Prev][Date Next][Date Index]

[linux] Adding/Deleting Users on RH 9.0 using command line options.


More information about such command line options can be found here
 
First assign an initial password, use the following steps:
WITH PYTHON:
#>python
Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Then enter the following command
>>>import crypt; print crypt.crypt("secretpassword","salt")
sateP4FAiCZmc  <== This will be spit out by the about command; Copy this vaue
 
--OR--
 
WITH PERL:
#> perl -e 'print("Encrypted Password: ", crypt("secretpassword","salt"),"\n")'
Encrypted Password: sateP4FAiCZmc
 
 
 
 
Before Adding the user use the groupadd command to add a group.. for e.g.
 
#>groupadd temp1
#>useradd -c "Temporary user" -d /home/sshvpn -g temp1 -m -p "sateP4FAiCZmc" temp1
 
 -c Comment
-d Specify the home directory
-g Specify the group to which user belongs
-m Create a home directory and copy files from /etc/skel to that directory
-p encrypted password from above.
 
User and group will be removed by issuing the command
#> userdel -r temp1
 
 
Default options that apply to all users can be viewed using the command
#> useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/tcsh
SKEL=/etc/skel
 
I have changed the default shell using the command
#> useradd -D -s /bin/tcsh
 
 
user usermod command to modify the current users account. try
#> man usermod
and use appropriate options..
 
to view all user/goups cat /etc/passwd and /etc/group files.
 
 
Regards
Shashank
http://mia.ece.uic.edu/~papers