Date created: Friday, November 10, 2017 11:55:24 AM. Last modified: Thursday, October 6, 2022 1:49:11 PM
CIFS/SMB Notes
CentOS:
# Test SMB connectivity
sudo yum install samba-client.x86_64
smbclient "//192.168.0.10/Share With Space In Name" -U ADDOMAIN\\user.name
# Mount share
sudo yum install cifs-utils
sudo mkdir /media/fs
sudo mount.cifs -o user=username,pass=5up3r53cr37,dom=ADDOMAIN "//192.168.0.10/Share With Space In Name" /media/fs
sudo umount /media/fs
Ubuntu:
Accessing shares:
sudo apt-get install cifs-utils
# Might need a restart after the above, to load the cifs kernel module, check with 'lsmod | grep cifs'
# One-time mount a guest share which doesn't require authentication
sudo mount -t cifs -o user=guest,pass=pass,dom=WORKGROUP "//192.168.0.123/Guest Share" /media/nas
# Add a guest share to the fstab with the following entry, note the space in the share name is escaped with: \040
//192.168.0.123/Guest\040Share /media/nas cifs guest,uid=1000 0 0
# Test with
sudo mount -a
Adding new users:
# They need to exist as system users too
sudo useradd -NM -s /bin/false -p abc123 smb_user
sudo smbpasswd -a smb_user
Previous page: Bash Profile
Next page: 'curl' - Notes