Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `/etc/network/interfaces`
- ```
- # This file describes the network interfaces available on your system
- # and how to activate them. For more information, see interfaces(5).
- source /etc/network/interfaces.d/*
- # The loopback network interface
- auto lo
- iface lo inet loopback
- # The primary network interface
- allow-hotplug eth0
- iface eth0 inet dhcp
- post-up /etc/network/if-up.d/cifs-mount
- ```
- `/etc/network/if-up.d/cifs-mount`
- ```
- #! /bin/sh
- # Remount network dependant CIFS mounts when the eth0 interface comes up.
- set -e
- cat /etc/fstab | grep cifs | sed 's/\,\?noauto\,\?//' >/tmp/cifs-fstab
- cat /tmp/cifs-fstab
- mount -a --fstab /tmp/cifs-fstab
- rm /tmp/cifs-fstab
- exit 0
- ```
- `/etc/fstab`
- ```
- # /etc/fstab: static file system information.
- #
- # Use 'blkid' to print the universally unique identifier for a
- # device; this may be used with UUID= as a more robust way to name devices
- # that works even if disks are added and removed. See fstab(5).
- #
- # <file system> <mount point> <type> <options> <dump> <pass>
- /dev/sda1 / ext4 errors=remount-ro 0 1
- /dev/sda5 none swap sw 0 0
- /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
- //192.168.0.1/share /mnt/share cifs noauto,credentials=/home/user/.smbcredentials,iocharset=utf8,sec=ntlm,file_mode=0777,dir_mode=0666,noperm 0 0
- ```
- `/home/user/.smbcredentials`
- ```
- username=WindowsUser
- password=########
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement