samba.md
Posted wittxie
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了samba.md相关的知识,希望对你有一定的参考价值。
How to use samba to share your folder in linux
Share your folder in linux by samba
Install samba
I use ubuntu taking an example.
apt-get install samba
Edit file smb.conf
vim this file
vim /etc/samba/smb.conf
Add some configuration in smb.conf
[witt-share] # your space-name sharing to others
comment = my sharing space # your comment
path = /home/witt/work/ # the sharing folder path
valid users = witt #this user-name is offering others to login your sharing folder
create mask = 0777
directory mask = 0777
public = yes
writable = yes
available = yes
browseable = yes
Add a valid user
sudo smbpasswd -a [your valid users]
sudo smbpasswd -a witt
Restart the samba server
sudo systemctl restart smbd
Login in the sharing folder
Linux
sudo smbclient -U [shared username]
Style 1 - smbclient
apt-get install smbclient
sudo smbclient -U witt //192.168.18.131/work
Style 2 - mount
apt-get install cifs-utils
sudo mount -t cifs -o username=‘[shared-username]‘,password=‘[your password]‘,dir_mode=0777,file_mode=0777 //192.168.18.131/work /mnt/share-work/
Windows
Input the following elements on the address box of windows explorer
\\192.168.18.131\work
you can also mount it into your computer as an remote disk.
That all.Thank your reading.
以上是关于samba.md的主要内容,如果未能解决你的问题,请参考以下文章