0
点赞
收藏
分享

微信扫一扫

samba应用

kmoon_b426 2022-03-18 阅读 63

samba 
1、安装
yum -y install samba
2、新访问用户
useradd -s /bin/false lish
给本地用户赋访问密码
smbpasswd -a lish
或pdbedit -add lish

启动smb: systemctl start smb

3、共享实验
共享自定义共享目录/test
smb.conf配置文件添加
 

[test]
        comment = Home Directories
        path = /test
        browseable = yes
        writable = yes
        public = yes
;      valid users = wan   #限制用户登陆,多个用逗号分开,组前面加@
;      read only =yes   #限制为只读
;      write list = wan #允许哪个用户为可写用户,规则与valid users 相同
;      create mask = 666    #上传文件权限设置
;      directory mask = 777  #上传目录权限设置


4、给test目录写入权限 : chmod o+w /test


5、客户端登陆
linux: 先安装samba-client
yum -y install samba-client
查看共享状态
smbclient -U lish -L //192.168.85.33
登陆共享目录
 smbclient -U lish //192.168.85.33/lish
上传:put   下载:get 

windows:
安装samba组件
\\ip\共享目录
如:\\192.168.85.33\lish

用 cmd命令   net use * /del    清除访问缓存

6、以下为学习截图

 

 

 

 

 

 

 

 

举报

相关推荐

0 条评论