If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.
如果要在Ubuntu和Windows计算机之间共享文件,最好的选择是使用Samba文件共享。
To install, first open a terminal window and enter the following command:
要安装,请首先打开一个终端窗口,然后输入以下命令:
sudo apt-get install samba smbfs
sudo apt-get install samba smbfs
We’ve got samba installed, but now we’ll need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice:
我们已经安装了samba,但是现在我们需要对其进行配置以使其可访问。 运行以下命令以打开配置文件,替换您选择的编辑器:
sudo gedit /etc/samba/smb.conf
须藤gedit /etc/samba/smb.conf
Find this section in the file:
在文件中找到此部分:
####### Authentication #######
#######身份验证#######
# “security = user” is always a good idea. This will require a Unix account# in this server for every user accessing the server. See# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html# in the samba-doc package for details.; security = user
#“安全=用户”始终是一个好主意。 每个访问该服务器的用户都需要在该服务器上有一个Unix帐户#。 有关详细信息,请参见samba-doc软件包中的#/usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html#。 安全=用户
Uncomment the security line, and add another line to make it look like this:
取消注释安全线,然后添加另一行使其看起来像这样:
security = userusername map = /etc/samba/smbusers
安全性=用户用户名映射= / etc / samba / smbusers
This will set Samba to use the smbusers file for looking up the user list.
这将使Samba设置为使用smbusers文件查找用户列表。
Create a Samba User
创建一个Samba用户
There are two steps to creating a user. First we’ll run the smbpasswd utility to create a samba password for the user.
创建用户有两个步骤。 首先,我们将运行smbpasswd实用程序为用户创建一个samba密码。
sudo smbpasswd -a <username>
sudo smbpasswd -a <用户名>
Next, we’ll add that username to the smbusers file.
接下来,我们将该用户名添加到smbusers文件中。
sudo gedit /etc/samba/smbusers
须藤gedit / etc / samba / smbusers
Add in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername> = “<samba username>”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.
添加以下行,用要授予访问权限的用户名替换用户名。 格式为<ubuntuusername> =“ <samba用户名>”。 您可以使用其他的samba用户名来映射到ubuntu帐户,但是现在并不需要。
<username> = “<username>”
<用户名> =“ <用户名>”
Now you can create samba shares and give access to the users that you listed here.
现在,您可以创建samba共享并向您在此处列出的用户授予访问权限。
翻译自: https://www.howtogeek.com/howto/ubuntu/install-samba-server-on-ubuntu/