This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:linux:linux_smb [2014/01/25 11:11] gcooper |
networking:linux:linux_smb [2018/01/15 12:08] (current) gcooper |
||
---|---|---|---|
Line 13: | Line 13: | ||
:!: If name resolution fails, try the IP address of the server. | :!: If name resolution fails, try the IP address of the server. | ||
+ | |||
+ | :!: If you need multiple users to access the share, you'll need to work with '' | ||
===== Older Distros ===== | ===== Older Distros ===== | ||
Line 94: | Line 96: | ||
</ | </ | ||
+ | ===== Script ===== | ||
+ | |||
+ | :!: Script must run as root. | ||
+ | |||
+ | :!: Limit visibility as the script contains passwords (not secure). | ||
+ | |||
+ | < | ||
+ | sudo chown root.root / | ||
+ | |||
+ | sudo chmod 4700 / | ||
+ | </ | ||
+ | |||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | # ~/ | ||
+ | # Make sure package cifs-utils is installed | ||
+ | # Store this file in your home directory with 4700 perms as it needs to run suid and contains SMB password | ||
+ | |||
+ | # Set variables here: | ||
+ | SMBSERVER=< | ||
+ | SHARENAME1=< | ||
+ | SHARENAME2=< | ||
+ | SMBUSER=< | ||
+ | SMBPASS=< | ||
+ | SMBDOM=< | ||
+ | USERNAME=< | ||
+ | USERGROUP=< | ||
+ | # End of variables | ||
+ | |||
+ | mkdir -p / | ||
+ | mkdir -p / | ||
+ | |||
+ | #These older commands did not need to be run as root | ||
+ | #smbumount ~/ | ||
+ | #smbmount // | ||
+ | #smbumount ~/ | ||
+ | #smbmount // | ||
+ | |||
+ | umount / | ||
+ | mount -t cifs // | ||
+ | umount / | ||
+ | mount -t cifs // | ||
+ | |||
+ | </ |