Notes -ubuntu19 Shared Folders

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

  1. Open the file software, find the need to share a folder, right click - Properties - Local network share

  2. Check the shared directory, then you will be prompted to install samba, click Install

  3. 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

  4. Use input run in windows \\ip地址you can see the shared folder

  5. Or new network location in the resource manager, in accordance with ip address prompted

Command Line

  1. Install samba
    sudo apt-get insall samba
    sudo apt-get install smbfs

  2. Create a shared directory
mkdir /home/share --创建目录
sodu chmod 777 /home/share --修改目录权限
  1. 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
  1. Creating samba accounts
sudo touch /etc/samba/smbpasswd
sudo smbpasswd -a phinecos
--然后输入samba账号的密码
  1. Restart samba
    sudo /etc/init.d/smbd restart

  2. Direct access to tests or test windows
    smbclient -L //localhost/share

Guess you like

Origin www.cnblogs.com/wyid/p/12099475.html