Adding and removing users
Adding users
Be root.
To add a new user named Laila Sara with laila as the user name, do the following:
Check the number of the next free userid, by the command tail /etc/passwd
Make a catalogue for the new user. Write:
mkdir /home/laila
Then write the following command. It shall be written in one line, but is here written on multiple lines for readability. The number nnnnn is the next free userid number in the passwd file.
adduser -u nnnnn -G cvs -c "Laila Sara, Samisk inst." -s /bin/bash laila
Then assign the new user a password, by writing:
passwd laila
The user must own her own catalogue. This is achieved by writing:
chown laila:laila /home/laila
In order to add laila to another group, use this command:
usermod -G corpus,cvs laila
Note that here, laila was already member of the group cvs, and we wanted to make her member of corpus. We still had to give all intended group memberships (except the personal group), otherwise she would have been kicked out of cvs.
Remember to copy the .bashrc, .bash_profile and .emacs files to the laila account while you are still a root user. Remember to run the initial cvs get command.
If the user has forgot his/her own password, log in as root, and enter the command passwd laila. You will not be prompted for the old password, and the new one you enters will erase the old one.
Removing users
For removing (in this example the user laila), be root, and use this command (-r removes the files of the user as well):
/usr/sbin/userdel -r laila rm -r /export/home/laila cd /var/yp make
A general warning: The commands that the manuals say should work, do work, if you just write /sbin/ in front of them, i.e. probably /sbin/userdel instead of userdel.
Last modified: $Date: 2006/06/28 19:09:26 $, by $Author: trond $
by Trond Trosterud


