275a0b085d6cb4afe29f0e693324e792421f05ae
ubuntu/samba/\350\265\267\345\213\225\346\231\202\343\201\253samba\343\202\222\343\203\236\343\202\246\343\203\263\343\203\210\343\201\231\343\202\213.md
| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | +[Proper fstab entry to mount a samba share on boot? - Ask Ubuntu](https://askubuntu.com/questions/157128/proper-fstab-entry-to-mount-a-samba-share-on-boot) |
|
| 2 | + |
|
| 3 | +``` |
|
| 4 | +$ sudo apt-get install cifs-utils |
|
| 5 | +``` |
|
| 6 | + |
|
| 7 | +1. `/etc/fstab`に以下を追加する. |
|
| 8 | + |
|
| 9 | + ``` |
|
| 10 | + //server/share /pathto/mountpoint cifs credentials=/home/username/.smbcredentials,uid=shareuser,gid=sharegroup 0 0 |
|
| 11 | + ``` |
|
| 12 | + |
|
| 13 | +2. `~/.sambacredentials`を作成し,以下を追加する. |
|
| 14 | + |
|
| 15 | + ``` |
|
| 16 | + username=shareuser |
|
| 17 | + password=sharepassword |
|
| 18 | + domain=domain_or_workgroupname |
|
| 19 | + ``` |
|
| 20 | + |
|
| 21 | +3. `~/.sambacredentials`を自分以外は読み取れないように変更する. |
|
| 22 | + |
|
| 23 | + ``` |
|
| 24 | + $ chmod 0600 ~/.smbcredentials |
|
| 25 | + ``` |
|
| 26 | + |
|
| 27 | +4. マウントできることを確認する. |
|
| 28 | + ``` |
|
| 29 | + $ sudo mount -a |
|
| 30 | + ``` |
|
| ... | ... | \ No newline at end of file |