赞
踩
TCP:139/445
UDP:137/138
amba 服务自有密码文件通过 smbpasswd -a USERNAME
命令设置
- //smbpasswd 命令:
- -a Sys_User //添加系统用户为 samba 用户并为其设置密码
- -d //禁用用户帐号
- -e //启用用户帐号
- -x //删除用户帐号
-
-
- [root@localhost ~]# yum -y install samba-*
- [root@localhost ~]# useradd tom
- [root@localhost ~]# smbpasswd -a tom
- New SMB password:
- Retype new SMB password:
- Added user tom.
server:192.168.255.180
client:192.168.255.150
- systemctl stop firewalld && systemctl disable firewalld
- setenforce 0
- yum -y install ntp && ntpdate ntp.aliyun.com
-
-
- yum -y install samba-* &> /dev/null
- systemctl start smb && systemctl enable smb
- #添加全局配置
- vim /etc/samba/smb.conf
- ......
- [global]
- workgroup = SAMBA
- security = user
- map to guest = Bad User
- ......
-
- #创建共享文件夹
- mkdir -p /opt/yc
- chmod 777 /opt/yc/
- ll /opt/
-
- #配置共享
- cat >> /etc/samba/smb.conf << EOF
- [yc]
- comment = yc
- path = /opt/yc
- browseable = yes
- guest ok = yes
- writable = yes
- public = yes
- EOF
-
- #测试配置文件是否有误
- testparm
-
- #重启服务
- systemctl restart smb
- #客户端验证
- smbclient -L 192.168.255.180 -U 'Bad User' #123456
- mkdir -p /opt/smb
- mount -t cifs //192.168.255.180/yc /opt/smb/ -o username='Bad User'
- df -h
-
- #在客户端上创建共享目录,文件
- cd /opt/smb/ && touch test && mkdir yanchuang
- ls
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。