Managing Users on the Cluster

In order for someone to gain access to a cluster, s/he must first be given a user account. The cluster administrator can manage user accounts with the same tools that are available with most Linux distributions. User access to cluster resources can also be controlled by the cluster administrator.

This chapter discusses the tools and commands for managing user accounts and controlling access to cluster resources.

Managing User Accounts

Adding New Users

The useradd command enables you to add a new user to the system. This command takes a single argument, which is the new user's login name:

[root@cluster ~] # useradd <username> 

This command also creates a home directory named /home/<username>.

After you add the user, give them a default password using the passwd command so that they will be able to log in. This command takes a single argument, which is the username:

[root@cluster ~] # passwd <username>

Tip

It is good practice to give each user their own unique home directory.

Removing Users

To remove a user from your cluster, use the userdel command. This command takes a single argument, which is the username:

[root@cluster ~] # userdel <username>

By default, userdel does not remove the user's home directory. To remove the home directory, include the -r option in the command:

[root@cluster ~] # userdel -r <username>

Tip

The userdel command will never remove any files that are not in the user's home directory. To fully remove all of a user's files, remove the user's mail file from /var/spool/mail/, as well as any files s/he may have in /tmp/, /var/tmp/, and any other directories to which s/he had write permissions.