Adding users and groups

SuSE YaST, Samba and new users ...

In theory it is very easy to add groups and users just by using the SuSE YaST program.Unfortunately that program does not remind the administrator to update Samba files and it does not like long user names or group names.

Content revision history:
Article first written, spring 2004
Links added 9th September 2004

SuSE GNU/Linux 8.1:

Adding users and groups is a relatively easy process but, especially when Samba is being used, it requires several steps and it is easy to overlook something.

First you need to know what system files are involved in the process:

Approximate purpose

File name (SuSE 8.1)

Ordinary list of Linux users /etc/passwd
Shadow list of Linux users, contains encrypted passwords. /etc/shadow
Ordinary list of Linux groups /etc/groups
Shadow list of Linux groups /etc/gshadow
List of Samba users /etc/samba/smbpasswd

When adding users to a system, these are the files that you are going to be manipulating one way or another.And, as is usually the case on a GNU/Linux system, there are several methods for accomplishing the task:

Adding a user, method 1.

The steps are these:

  • Add the user to the system by editing the /etc/passwd file.
  • Give the user a password by running the passwd program.
  • Transfer the user into the shadow files by running the pwconv program.

If a Samba server is operating and the user is supposed to be able to access resources provided by Samba then it is necessary to perform the following extra steps.

  • Run the smbuseradd program to tell Samba about the user.
  • Run the smbpasswd program to give the user a Samba password.

It might be convenient, but it is not essential, to use the same names and passwords for Samba as are used for the underlying GNU/Linux host.

Adding a user, method 2.

The steps are these:

  • Add the user to the system by running the useradd program.
  • Give the user a password by running the passwd program.
  • Transfer the user into the shadow files by running the pwconv program.

If a Samba server is operating and the user is supposed to be able to access resources provided by Samba then it is necessary to perform the following extra steps.

  • Run the smbuseradd program to tell Samba about the user.
  • Run the smbpasswd program to give the user a Samba password.

It might be convenient, but it is not essential, to use the same names and passwords for Samba as are used for the underlying GNU/Linux host.

Adding a user, method 3.

The steps are these:

  • Use the YaST program, choose “security and groups” from the main menu.

If a Samba server is operating and the user is supposed to be able to access resources provided by Samba then it is necessary to perform the following extra steps.

  • Run the smbuseradd program to tell Samba about the user.
  • Run the smbpasswd program to give the user a Samba password.

It might be convenient, but it is not essential, to use the same names and passwords for Samba as are used for the underlying GNU/Linux host.

Adding a group, method 1.

The steps are these:

  • Add the group to the system by editing the /etc/group file.
  • Transfer the group into the shadow files by running the grpconv program.

The above steps are a gross simplification of what is possible with groups. Groups can also be given passwords.

Related articles:

Using Windows 2000 clients with a Samba server has, it seems, been a cause of much puzzlement for many people.If you have any intention of attaching Windows 2K computers to your Samba network then please read the following article: Samba server and a Win2K client

 

Navigation: (site map) learn linux home pagetechnical articles