wiki:linux/Samba

Create a samba user

# adduser --uid [UID] --no-create-home --disabled-login [USERNAME]
# smbpasswd -a [USERNAME]

If some permissions depends to a group:

# groupadd --gid [GID] [GROUPNAME]
# usermod -a -G [GROUPNAME] [USERNAME]

On users local machine:
Change user id in linux

Logout the user which uid you want to change. After this login as root. If root has no login password, create it:

# passwd root

Change UID via usermod which will change the UID's of files within /home/[USERNAME] automatically:

# usermod -u [UID] [USERNAME]

Changing [USERNAME]'s GID is needed e.g. for backups via rsync. Otherwise a permission error will be reported. Therefor change GID of [USERNAME]'s group via groupmod and [USERNAME]'s GID via usermod. Files GID's within /home/[USERNAME] must be changed manually:

# groupmod -g [GID] [GROUPNAME]
# usermod -g [GID] [USERNAME]
# find /home/ -group [OLDGID] -exec chgrp -h [NEWGID] {} \;

Login

ubuntuusers wiki

Be sure the cifs-utils package is installed on the client machine!

# mount -t cifs //[SERVERIP]/[SHARENAME] /[MOUNTPOINT] -o username=[SAMBAUSERNAME]

[MOUNTPOINT] should be a directory within client users home.

Last modified 4 years ago Last modified on Apr 27, 2015, 6:58:15 PM