cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

os:linux:command:mount.html



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
  • By default windows share mounted with the full permission (777) in Linux.

/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




os/linux/command/mount.html.txt ยท Last modified: 2018/02/09 by admin

Page Tools