Tag Archives: samba

User Management Commands

smbpasswd -x foo (delete samba user)
smbpasswd -a foo (create samba user)

useradd -M foo (create user with no home directory)
useradd -c “name” -M foo (create user with real name)
userdel -r foo (delete user’s files and home directory)
userdel foo (delete only user entry)
usermod -a -G group user (add an existent user to a group)
useradd -g group user (add a new user to a group)
useradd -G group1,group2,group3 user (add user to a list of groups)
groupadd name_group (create a group)
id -nG user (show groups for user)
groupdel (delete an existent group)
adduser (verbose command to create users)

default user add file on Red Hat (/etc/default/useradd)
default user add file on Debian (/etc/adduser.conf)


Mount Samba volume

to mount smb volume:

# smbclient --list host_smb_server

when you already know which folder you want to mount then

# mount -t cifs -o username=joe //host_dir/shared_folder /media/smb

this command will prompt you the password… type it.

to find out what is mounted on system:

# mount