Install samba on Linux 16.04 LTS
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Install samba on Linux 16.04 LTS相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章