Software >> OS >> Unix >> Linux >> RHEL >> 7 >> How to use SAMBA to connect to CIFS shares

 

You need to have the following packages

yum -y install cifs-utils samba-client

assuming you have a CIFS server fileserver1 with fileshare named share1


Method (1) - to mount permanently, edit /etc/fstab

//fileserver1/share1  /mnt/mountpoint  cifs  rw,username=username-on-fileserver1,password=password-for-username  defaults  0 0


Method (2) - mount with mount.cifs

mount.cifs //fileshare1/share1 /mnt/mountpoint -o username=username-on-fileserver1

when prompted, enter the password


Method (3) - mount with mount  

mount -t cifs //tfmnas/volume_1 /mnt/nas -o username=arahman

when prompted, enter the password


Method (4) - connect with smbclient and use FTP-style operations

smbclient //fileserver1/share1 -U username-on-fileserver1

when prompted, enter the password

smb>