Table of Contents

Linux Commands Cheat Sheet

mount : How to use mount command in Linux with examples



CIFS

Temporarily mount

# mount -t cifs //xx.xx.xx.xx/test /mnt/test -o username=guest,password=
# mount -t cifs -o username=<USER>,password=<PASS> //WIN_PC_IP/<share name> /mnt

# mount -t cifs -o username=<USER>,password=<PASS>,domain=example.com //WIN_PC_IP/<share name> /mnt

# mount -t cifs -o username=<USER>,password=<PASS>,dir_mode=0755,file_mode=0755,dir_mode=0700,uid=501,gid=501 //WIN_PC_IP/<share name> /mnt

/etc/fstab

//WIN_PC_IP/<share name>    /<mntpoint>   cifs  _netdev,username=<USER>,password=<PASS>,dir_mode=0755,file_mode=0755,uid=500,gid=500 0 0

How to hide Active Directory Passwords

# yum install samba3x-client
# vi /etc/fstab.pass

username=test-user01
password=XXXXXXX
domain=example.jp
# chown root:root /etc/fstab.pass
# chmod 600 /etc/fstab.pass
# vi /etc/fstab

//192.168.xx.xx/test /mnt/test  cifs credentials=/etc/fstab.pass,dir_mode=0555,uid=xxx,gid=xxx,ro 0 0
# mount -a





Linux Commands Cheat Sheet