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

[vmware-samba-share]
comment = my sharing space
path = /home/witt/work/
valid users = witt
create mask = 0777
directory mask = 0777
public = yes
writable = yes
available = yes
browseable = yes
security = share
guest ok = 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.

posted @ 2019-03-29 17:09  WittXie  阅读(237)  评论(0编辑  收藏  举报