服务端
安装samba服务端软件 [root@k8s-master ~]# yum install samba -y #行尾追加如下配置 [root@k8s-master ~]# vim /etc/samba/smb.conf [test] comment=test path=/data/test public=no writable=yes guest ok=yes browseable = No #配置用户(需为系统用户) [root@k8s-master ~]# pdbedit -a ryan new password: retype new password: Unix username: ryan NT username: Account Flags: [U ] User SID: S-1-5-21-4078010164-3830430468-3768480104-1000 Primary Group SID: S-1-5-21-4078010164-3830430468-3768480104-513 Full Name: Home Directory: \\k8s-master\ryan HomeDir Drive: Logon Script: Profile Path: \\k8s-master\ryan\profile Domain: K8S-MASTER Account desc: Workstations: Munged dial: Logon time: 0 Logoff time: Wed, 06 Feb 2036 23:06:39 CST Kickoff time: Wed, 06 Feb 2036 23:06:39 CST Password last set: Sun, 20 Feb 2022 23:35:54 CST Password can change: Sun, 20 Feb 2022 23:35:54 CST Password must change: never Last bad password : 0 Bad password count : 0 Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF #配置共享目录权限 [root@k8s-master ~]# chown -R ryan /data/test #重启smaba服务 [root@k8s-master ~]# systemctl restart smb
客户端
#安装smaba客户端软件 [root@k8s-node2 ~]# yum install -y samba-client #创建待挂载目录 [root@k8s-node2 ~]# mkdir /test [root@k8s-node2 ~]# mount -t cifs //172.16.0.4/test /test -o username=ryan,password=**** [root@k8s-node2 ~]# df -h |grep test //172.16.0.4/test 50G 13G 38G 25% /test
评论留言