SELinux引发的FTP、Samba的错误

今天在Fedora 12 下配置ftp的时候,按以前的步骤弄好后竟然本地用户无法登陆,整了很久都没解决问题,报错如下:

ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 Welcome to my fedora FTP service.
ftp> user stu1
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/stu1
Login failed.
ftp> bye
500 OOPS: child died

黔驴技穷后只好请出万能的google,才知道原来所SELinux 搞的鬼,网络大部分提供的解决方法:
7^luj/he@0@:L%C0在终端输入命令:
xoX*eh.j0setsebool ftpd_disable_trans 1

但是我输入时候却出现了问题

[root@lin-fedora mnt]# setsebool ftpd_disable_trans 1
Could not change active booleans: Invalid boolean
可能所因为系统版本不同,无法执行,也就算说原理所一样的,就是命令的语法可能不一样

后来又搜到获取SELinux 设置项的指令,由此得到启发,最后果然如我所料,成了~

[root@lin-fedora ~]# getsebool -a | grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> off
ftpd_connect_db --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
[root@lin-fedora ~]# setsebool ftp_home_dir on
[root@lin-fedora ~]# ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 Welcome to my fedora FTP service.
Name (127.0.0.1:lin): user stu1
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> user lin
331 Please specify the password.
Password:
230 Login successful.
ftp> ls
227 Entering Passive Mode (127,0,0,1,20,203).
150 Here comes the directory listing.
drwxr-xr-x    2 500      500          4096 Aug 04 04:53 Desktop
drwxr-xr-x    2 500      500          4096 Aug 03 11:09 Documents
drwxr-xr-x    2 500      500          4096 Aug 03 11:09 Downloads
drwxr-xr-x    2 500      500          4096 Aug 03 11:09 Music
drwxr-xr-x    2 500      500          4096 Aug 03 11:09 Pictures
drwxr-xr-x    2 500      500          4096 Aug 03 11:09 Public
drwxr-xr-x    2 500      500          4096 Aug 03 11:09 Templates
drwxr-xr-x    2 500      500          4096 Aug 03 11:09 Videos
226 Directory send OK.
ftp>

#####################################################

上午的Samba 服务器更纠结,同样也是因为SELinux 花了不少时间,在设置访问用户家目录的时候也所要用setsebool来打开SELinux 中的限制。不过这个还好在配置文件有说明

# Turn the samba_enable_home_dirs Boolean on if you want to share home
# directories via Samba. Run the following command as the root user to turn this
# Boolean on:
# setsebool -P samba_enable_home_dirs on

###

samba的挂载常用命令

mount -t cifs //ip addr/Public  /mount/point  -o username=xxxx

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值