centos下Samba配置 解决没有权限问题
yum install samba system-config-samba samba-client samba-common2、创建www账号 /usr/sbin/groupadd www
/usr/sbin/useradd -g www www
mkdir -p /data/
chown -R www:www /data/
chmod 777 /data/
cat /etc/passwd | mksmbpasswd.sh> /etc/samba/smbpasswd 3、创建samba配置文件mv -f /etc/samba/smb.conf /etc/samba/smb.conf.bak
vim /etc/samba/smb.conf 输入以下内容:[global]
server string = Samba Server
security = user //如果需要匿名访问这个修改成share,下文的net目录就可以匿名访问
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd[net]
public = yes
path = /data/net[web]
workgroup = www
netbios name = www
path = /data/
browseable = yes
writeable = yes
4、为samba用户www设立一个密码:
smbpasswd -a www
5、启动samba:
/sbin/service smb start
6添加到系统启动
vim /etc/rc.d/rc.local
末行加入
/etc/init.d/smb restart
7、在iptables中139端口,或者关闭iptables,/sbin/service iptables stop
8、在我的电脑上右键--映射网络驱动器,输入samba服务器的ip,输入www用户名和设置的密码,即可进入,如果提示没有权限可能是selinux问题,处理方法见 关闭SELinux的两种方法
断开共享连接cmd命令
net use * /del
发表评论:
昵称
邮件地址 (选填)
个人主页 (选填)