操作环境:
两台虚拟机,一台安装samba服务,一台安装samba客户端。
-
yum install samba* -y //samba服务 192.168.80.100
yum install samba-client -y //samba客户端192.168.80.101
vi /etc/samba/smb.conf
[database]
comment = this is test file
path = /opt/database
public = yes
read only = yes
writable = yes
write list = jack
create mask = 0644
directory mask = 0777
systemctl restart smb #重启服务
smbclient -L //192.168.80.100 -U tom
yum install cifs-utils -y
[root@localhost ~]# mount -t cifs --verbose -o username=tom,password=123 //192.168.80.100/database /opt/aa
mount.cifs kernel mount options: ip=192.168.80.100,unc=\\192.168.80.100\database,user=tom,pass=********
df -hT
如果在目录里面创建不了文件到80.100上面输入
chmod 777 /opt/database 因为没有权限这条命令是给这个目录权限全开