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 10:30] gcooper |
networking:linux:linux_smb [2018/01/15 12:08] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Mounting SMB (Windows) Shares on Linux ====== | ====== Mounting SMB (Windows) Shares on Linux ====== | ||
- | |||
- | FIXME This doesn' | ||
===== Newer Distros ===== | ===== Newer Distros ===== | ||
Line 7: | Line 5: | ||
< | < | ||
sudo apt-get install cifs-utils | sudo apt-get install cifs-utils | ||
- | sudo mkdir / | ||
- | sudo mount -t cifs // | ||
</ | </ | ||
- | |||
- | If mane resolution fails, try the IP address of the server: | ||
< | < | ||
- | sudo mount -t cifs //192.168.0.100/ samba/ -o rw | + | sudo mkdir / |
+ | sudo mount -t cifs //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 97: | 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 // | ||
+ | |||
+ | </ |