signed

QiShunwang

“诚信为本、客户至上”

ubuntu smba常用设置

2021/6/3 16:10:40   来源:

添加系统用户:

adduser	username

追加smba:

smbpasswd -a username

配置smb.conf
取消里面原有配置

security = user

[sshare]

comment = samba

path = /opt

public = no

writable = yes

valid users = lxt

create mask = 0777

directory mask = 0777

新添加如下

vi /etc/samba/smb.conf
	valid users = bbb,aaa,ccc
chmod 777 /opt/sharex
sudo restart smbd && sudo restart nmbd  ### sudo /etc/init.d/samba restart
sudo restart smbd && sudo restart nmbd

更改用户密码

sudo	passwd	guest		XXX
sudo	smbpasswd	guest		xxx

更改文件权限:

常用方法如下:

sudo chmod 600 ××× (只有所有者有读和写的权限),

sudo chmod 644 ××× (所有者有读和写的权限,组用户只有读的权限),

sudo chmod 700 ××× (只有所有者有读和写以及执行的权限),

sudo chmod 666 ××× (每个人都有读和写的权限),

sudo chmod 777 ××× (每个人都有读和写以及执行的权限),

参考文章:

  • https://blog.csdn.net/dragon101788/article/details/7792969
  • https://blog.csdn.net/iteye_7248/article/details/82523966
  • https://blog.csdn.net/aaaaaab_/article/details/86687281