This article recording step of ubuntu and windows folder sharing environment is ubuntu19, two methods, one is a graphical interface, a command line.
Graphical interface
Open the file software, find the need to share a folder, right click - Properties - Local network share
Check the shared directory, then you will be prompted to install samba, click Install
After a successful installation, you can configure the first step in the name of the shared directory, the comment and the need for account login, whether to allow modification; After completing the configuration is saved
Use input run in windows
\\ip地址
you can see the shared folderOr new network location in the resource manager, in accordance with ip address prompted
Command Line
Install samba
sudo apt-get insall samba
sudo apt-get install smbfs
- Create a shared directory
mkdir /home/share --创建目录
sodu chmod 777 /home/share --修改目录权限
- Create a Samba configuration file
--首先,备份现有配置文件
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
--修改配置文件
sudo vi /etc/samba/smb.conf
--在smb.conf最后添加
[share]
path = /home/phinecos/share
available = yes
browsealbe = yes
public = yes
writable = yes
--如果希望远程登录上来的账户拥有和文件所有者一样的权限,如下配置
[Share_all]
path = /home/phinecos/share
public = yes
writable = yes
guest ok = yes
force user = phinecos
- Creating samba accounts
sudo touch /etc/samba/smbpasswd
sudo smbpasswd -a phinecos
--然后输入samba账号的密码
Restart samba
sudo /etc/init.d/smbd restart
Direct access to tests or test windows
smbclient -L //localhost/share