码迷,mamicode.com
首页 > 系统相关 > 详细

Install samba on Linux 16.04 LTS

时间:2016-09-08 16:45:42      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:linux

suggeted reading:

 1. man smb.conf

 2. man smbpasswd


Steps:

do the following commands

sudo apt-get install samba

cd /etc/samba

sudp cp smb.conf smb.conf.bak

sudo vim /etc/smb.conf


In the file smb.conf, find section [homes], uncomment and modify the related lines, you will get the following lines in [homes] section:

comment = Home Directories
   browseable = yes

read only = no


create mask = 0775


directory mask = 0775


If you are a linux user, let‘s say, with name ‘abc‘, when you connect this linux PC with samba, you shall also use the same name, which is ‘abc‘. This will allow you to access your home directory in your linux PC.

Suppose your user name is ‘‘abc‘,  you need to do:

sudo smbpasswd -a abc

This command will allow you to add a samba user as well as to set the password for samba.

Then do the following command to enable the user:

smbpasswd -e abc


Now, in your windows pc, you can connect \\[ipaddress]\abc, supplying the user name and the password. Then you will be able to access your home directory.


That should be done for most of the users. But you may not be satisfied with the full home directory open to the connected user

If your you want to limit your accessible directory other than the default one, you can add one more line in your [homes] section(suppose you have a directory named ‘WORKDIR‘):

path = %H/WORKDIR


Here, in samba‘s language, %H means the home directory of the linux user.


Install samba on Linux 16.04 LTS

标签:linux

原文地址:http://greg10.blog.51cto.com/3430979/1850549

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