Linux学习笔记-配置SAMBA服务

SAMBA的配置:

SAMBA:Linux下的一个服务

作用:在Linux服务器上设置一个共享目录,人Windows主机上可以访问(读写)这个目录。

首先关闭2个服务:
1.关闭selinux(一个强化的安全子系统)
2.关闭firewall(防火墙)
【注意:自己实验可以这么搞,真正的上线的机子不要这边搞,要做精细的配置,管理员做的事情,不是开发搞的,搞开发的只要关这两个就阔以了】

关闭selinux
vi /etc/selinux/config
将SELINUX=enforcig改为:
SELINUX=disabled

关闭防火墙
关闭命令:service iptables stop 
永久关闭防火墙:chkconfig iptables off
两个命令同时运行(才生效),运行完成后查看防火墙关闭状态 
service iptables status


修改:
/etc/samba/smb.conf
去掉setsebool -p samba_enable_home_dirs on 前的#号
去掉[home]下的;valid users=%s中的;这个分号


添加SAMBA用户:
smbpasswd -a root

然后重启:service smb restart


开机自启:chkconfig smb on
查看smb状态:service smb status


登录进去:
//192.168.xxx.xxx

再设置一个映射网络驱动,就阔以了!

在/etc/samba/smb.conf后面加section就阔以了说明只有root用户可以访问:

[opt]
    comment=opt
    path=/opt
    writable=yes
    valid users=root


 

猜你喜欢

转载自blog.csdn.net/qq78442761/article/details/81516503
今日推荐