samba/connect.sh

raw link view readme
1 smbclient -L beta -U dbetz << EOF
2 hello
3 EOF
4
5 smbclient //beta/librarian -U jdoe << EOF
6 hello
7 EOF
8
9 cat > /mnt/.smbcredentials << EOF
10 username=jdoe
11 password=hello
12 EOF
13 chmod 600 /mnt/.smbcredentials
14
15 mkdir /mnt/jdoe_share
16
17 set -o noclobber
18 cat >> /etc/fstab << EOF
19 //beta/librarian /mnt/jdoe_share cifs credentials=/mnt/.smbcredentials,default 0 0
20 EOF
21
22 mount -a
23