-M -do not create the user’s home directory.-d /samba/josh - set the user’s home directory to /samba/josh.-s /usr/sbin/nologin - disable shell access for this user.-G sambashare - add the user to the sambashare group.Īnd set the directory ownership to user josh and group sambashare: sudo mkdir /samba/josh sudo chown josh:sambashare /samba/josh.The following command will add the setgid bit to the /samba/josh directory so the newly created files in this directory will inherit the group of the parent directory. For example, if you don’t set the directory’s permissions This way, no matter which user creates a new file, the file will have group-owner of sambashare. sudo chmod 2770 /samba/joshĪdd the josh user account to the Samba database by setting the user password: sudo smbpasswd -a josh To 2770 and the sadmin user creates a new file the user josh will not be able to read/write to this file. You will be prompted to enter and confirm the user password. Once the password is set, enable the Samba account by typing: sudo smbpasswd -e josh Enabled user josh. To create another user repeat the same process as when creating the user josh. Next, let’s create a user and group sadmin. Later if you want to grant administrative permissions to another user simply add that user to the sadmin groupĬreate the administrative user by typing: sudo useradd -M -d /samba/users -s /usr/sbin/nologin -G sambashare sadmin All members of this group will have administrative permissions. ![]() Set a password and enable the user: sudo smbpasswd -a sadmin sudo smbpasswd -e sadmin The command above will also create a group sadmin and add the user to both sadmin and sambashare groups.
0 Comments
Leave a Reply. |