Ubuntu中安装Samba
参考视频
https://www.bilibili.com/video/av49109983/
0.连接XShell
sudo apt-get install openssh-server
关闭防火墙(重要,一定要关闭防火墙)
sudo ufw disable
1.安装
sudo apt-get install samba
2.设置共享的目录权限
sudo chmod 777 /home/mao
3.配置samba
3.1打开samba配置文件
sudo vi /etc/samba/smb.conf
3.2配置内容
配置1:(**粘贴取消注释)
[mao]
comment = share folder
path = /home/mao # 共享路径
create mask = 0755
directory mask = 0755
valid users = mao
force user = mao
force group = mao
public = yes # 该共享是否允许guest账户访问
guest ok = yes # 意义同public
browseable = yes
available = yes # 该共享资源是否可用
writable = yes # 是否对该共享路径进行写操作
配置2:
[maosql]
comment = share folder
path = /home/maosql
valid users = maosql
available = yes
browsealbe = yes
public = yes
writeable = yes
4.重启samba服务
sudo /etc/init.d/smbd restart
5.添加用户:
sudo smbpasswd -a maosql
New SMB password:
Retype new SMB password:
Added user pika. //添加成功
6.window下
//ip地址/主机用户