Samba

Contents

Samba#

Client#

Warning

Exposing Samba to the Internet is not recommended and most Internet providers block Samba access by default.

For mount and automounting, the cifs-util package is required.

# yum install -y cifs-utils

For manual connections, you can use the following package is required.

# yum install -y samba-client

Query a server for shares

# smbclient -L //<server-name>

Query a server for shares for a specific user

# smbclient -L //<server-name> -U <username>

Mount a shares

# mount -t cifs -o guest //server/public /mnt

/etc/fstab

//server/public /mnt cifs guest,uid=1000,gid=1000 0 0

Mount a shares

# mount -t cifs -o username=user01,password=secret //server/public /mnt

/root/smb-credetials.txt chmod 600

username=user01
password=secret
# mount -t cifs -o credentials=/root/smb-credentials.txt //server/public /mnt

/etc/fstab

//server/public /mnt cifs credentials=/root/smb-credentials.txt 0 0

Automounting#

/etc/auto.master.d/smb.autofs

/mnt /etc/auto.samba

/etc/auto.samba