fedora 27 配置samba服务器

我配置的时候全程在root里面操作的:

su -    #进入root用户

配置samba:

    安装samba service

    yum install samba.service

开始配置samba:

    smbpasswd -a -U your_username               #设置登陆的用户名和密码,你可以运行 whoami 查看你的用户名

    systemctl enable smb.service                           # 开机启动samba
    systemctl start smb.service                               #  立即启动samba

    systemctl restart smb.service                             # 立即重启samba

    firewall-cmd --permanent --zone=public --add-service=samba                           # 配置防火墙

增加共享文件夹:

    mkdir /home/share

  chmod 777 /home/share #使share文件夹可读可写

在etc/samba/smb.conf中增加:

    [share]
        comment = share
        path = /home/share
        writable = yes

        valid users = your_username          # 你可以运行 whoami 查看你的用户名

#setsebool -P samba_enable_home_dirs on #命令解除selinux对samba的限制

配置好后,重启samba ( systemctl restart smb.service)

关闭 防火墙

systemctl stop firewalld.service

 systemctl disable firewalld.service

停止SELinux(如果不需要它)


vi /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#
enforcing - SELinux security policy is enforced. 
# permissive - SELinux prints warnings instead of enforcing. 
# disabled - SELinux is fully disabled. 
SELINUX= disabled # change here


# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected. 
# strict - Full SELinux protection. 
SELINUXTYPE=targeted

sestatus -v可以查看selinux状态。

getenforce也可以。

setenforce命令可以临时关闭selinux,不需要重启。

另外关闭windows的防火墙

使用ifcongfig查看ip


在windows随便一个文件夹下输入ip就可以登录进去啦。


  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值