差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
samba [2017/01/04 00:36] 127.0.0.1 |
samba [2023/06/11 00:58] (目前版本) jz |
||
---|---|---|---|
行 3: | 行 3: | ||
====== install ====== | ====== install ====== | ||
<code> | <code> | ||
- | pkg install samba44 | + | pkg install samba42 |
sysrc samba_server_enable="YES" | sysrc samba_server_enable="YES" | ||
</code> | </code> | ||
行 24: | 行 24: | ||
read only = no | read only = no | ||
guest ok = yes | guest ok = yes | ||
- | public = yes | ||
create mask = 0644 | create mask = 0644 | ||
directory mask = 0755 | directory mask = 0755 | ||
- | </code> | + | hosts allow = 140.116.0.0/255.255.0.0 |
- | ====== add samba user account ====== | + | [homes] |
- | <code> | + | path = /home/%U |
- | smbpasswd -a CSNA2016 | + | writable = yes |
+ | browsable = yes | ||
+ | read only = no | ||
+ | guest ok = no | ||
+ | create mask = 0644 | ||
+ | directory mask = 0755 | ||
+ | hosts allow = 140.116.0.0/255.255.0.0 | ||
</code> | </code> | ||
行 45: | 行 50: | ||
service samba_server start | service samba_server start | ||
</code> | </code> | ||
+ | |||
+ | ====== add samba user account ====== | ||
+ | <code> | ||
+ | smbpasswd -a CSNA2016 | ||
+ | </code> | ||
+ | |||
+ | ====== mount ====== | ||
+ | <code> | ||
+ | sudo mount -t cifs -o vers=3.0,username=${USER},password=${PASSWORD},uid=$(id -u),gid=$(id -g) //server-address/folder /mount/path/on/ubuntu | ||
+ | sudo mount -t cifs -o vers=3.0,username=${USER},password=${PASSWORD},uid=$(id -u),gid=$(id -g),forceuid,forcegid, //server-address/folder /mount/path/on/ubuntu | ||
+ | </code> | ||
+ | |||
+ | ====== List shares ====== | ||
+ | <code> | ||
+ | smbclient -L ip_of_net_interface -U your_user_name | ||
+ | </code> | ||
+ | |||
+ |