Skip to content

Instantly share code, notes, and snippets.

@hayleyxyz
Created May 16, 2020 03:18
Show Gist options
  • Save hayleyxyz/5d1aecd7c255a597387264966e10b9e8 to your computer and use it in GitHub Desktop.
Save hayleyxyz/5d1aecd7c255a597387264966e10b9e8 to your computer and use it in GitHub Desktop.
# mount.cifs
mount.cifs //hayley-pc/hayley /mnt/hayley -o credentials=/root/.cifscreds,uid=$(id -u hayley),gid=$(id -g hayley)
# /etc/fstab
echo //hayley-pc/hayley /mnt/hayley cifs credentials=/root/.cifscreds,uid=$(id -u hayley),gid=$(id -g hayley) 0 0
hayley@debian:~$ cat /etc/systemd/system/mnt-hayley.mount
[Unit]
Description=cifs mount script
Requires=network-online.target
After=network-online.service
[Mount]
What=//192.168.1.100/hayley
Where=/mnt/hayley
Options=credentials=/root/.cifscreds,uid=1000,gid=1000
Type=cifs
TimeoutIdleSec=10
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment