码迷,mamicode.com
首页 > 其他好文 > 详细

samba.md

时间:2019-03-29 17:29:40      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:position   level   let   int   mba   windows   elements   style   mode   

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

标签:position   level   let   int   mba   windows   elements   style   mode   

原文地址:https://www.cnblogs.com/wittxie/p/10622534.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!