无为清净楼资源网 Design By www.qnjia.com
这是一台squid代理服务器(一台式机,安装的是redhat 5.4 64位操作系统),每天下午4点一台服务器通过ftp上传主机数据库巡检报告到这台代理PC机的一个用户家目录下的xunjian目录下,这台PC再通过发送邮件的方式将巡检报告发给组内成员,进行巡检
此为背景,之前的selinux设置的为Permissive,不料同事中午睡觉的时候,脚这么一碰,将这台代理PC重启了,重启后,连续2天的巡检报告都没有通过邮件收到,赶紧解决吧
1、手动的执行ftp上传动作,报如下错误:553 Could not create file.
sshuser@station90.example.com:~/xunjian/0108> ftp 192.168.1.123
Connected to 192.168.1.123.
220 (vsFTPd 2.0.5)
Name (192.168.1.123:oracle): oracle
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>binary
200 Switching to Binary mode.
ftp> put xunjian_0108.zip
local: xunjian_0108.zip remote: xunjian_0108.zip
229 Entering Extended Passive Mode (|||10717|)
553 Could not create file.
2、代理PC的oracle家目录,肯定是有读写权限的,因为是代理PC重启导致的,突然想到selinux若开启的话,是不允许用户的家目录进行ftp的,需要将ftp_home_dir这个sebool打开,如下所示:
[root@squid ~]# getenforce
Enforcing
[root@squid ~]# getsebool -a | grep ftp_home_dir
ftp_home_dir --> off
[root@squid ~]# setsebool ftp_home_dir on
3、这时候去上传,就可以成功了,如下所示
sshuser@station90.example.com:~/xunjian/0108> ftp 192.168.1.123
Connected to 192.168.1.123.
220 (vsFTPd 2.0.5)
Name (192.168.1.123:oracle): oracle
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bi
200 Switching to Binary mode.
ftp> put xunjian_0108.zip
local: xunjian_0108.zip remote: xunjian_0108.zip
229 Entering Extended Passive Mode (|||19974|)
150 Ok to send data.
100% |***********************************************************************| 577 KB 2.31 MB/s 00:00 ETA
226 File receive OK.
591290 bytes sent in 00:00 (2.18 MB/s)
4、另外一种方式,就是将selinux设置为Permissive
[root@squid ~]# getenforce
Enforcing
[root@squid ~]# setenforce 0
[root@squid ~]# getenforce
Permissive
5、同时在/etc/rc.local中添加这么一行,那么下次系统重启后,就不会发生这样的情况了
[root@squid ~]# which setenforce
/usr/sbin/setenforce
[root@squid ~]# cat /etc/rc.local | tail -n 1
/usr/sbin/setenforce 0
好啦,这样就顺利解决问题了,希望对一些朋友有所帮助
此为背景,之前的selinux设置的为Permissive,不料同事中午睡觉的时候,脚这么一碰,将这台代理PC重启了,重启后,连续2天的巡检报告都没有通过邮件收到,赶紧解决吧
1、手动的执行ftp上传动作,报如下错误:553 Could not create file.
sshuser@station90.example.com:~/xunjian/0108> ftp 192.168.1.123
Connected to 192.168.1.123.
220 (vsFTPd 2.0.5)
Name (192.168.1.123:oracle): oracle
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>binary
200 Switching to Binary mode.
ftp> put xunjian_0108.zip
local: xunjian_0108.zip remote: xunjian_0108.zip
229 Entering Extended Passive Mode (|||10717|)
553 Could not create file.
2、代理PC的oracle家目录,肯定是有读写权限的,因为是代理PC重启导致的,突然想到selinux若开启的话,是不允许用户的家目录进行ftp的,需要将ftp_home_dir这个sebool打开,如下所示:
[root@squid ~]# getenforce
Enforcing
[root@squid ~]# getsebool -a | grep ftp_home_dir
ftp_home_dir --> off
[root@squid ~]# setsebool ftp_home_dir on
3、这时候去上传,就可以成功了,如下所示
sshuser@station90.example.com:~/xunjian/0108> ftp 192.168.1.123
Connected to 192.168.1.123.
220 (vsFTPd 2.0.5)
Name (192.168.1.123:oracle): oracle
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bi
200 Switching to Binary mode.
ftp> put xunjian_0108.zip
local: xunjian_0108.zip remote: xunjian_0108.zip
229 Entering Extended Passive Mode (|||19974|)
150 Ok to send data.
100% |***********************************************************************| 577 KB 2.31 MB/s 00:00 ETA
226 File receive OK.
591290 bytes sent in 00:00 (2.18 MB/s)
4、另外一种方式,就是将selinux设置为Permissive
[root@squid ~]# getenforce
Enforcing
[root@squid ~]# setenforce 0
[root@squid ~]# getenforce
Permissive
5、同时在/etc/rc.local中添加这么一行,那么下次系统重启后,就不会发生这样的情况了
[root@squid ~]# which setenforce
/usr/sbin/setenforce
[root@squid ~]# cat /etc/rc.local | tail -n 1
/usr/sbin/setenforce 0
好啦,这样就顺利解决问题了,希望对一些朋友有所帮助
标签:
selinux,ftp
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年10月09日
2024年10月09日
- 魔兽世界怎么获得泽克维尔的残血珍玩 泽克维尔的残血珍玩获取方式
- FrankSinatra-StrangersInTheNight(1966Jazz)[Flac24-96]
- 大原樱子《CAMON+5thAnniversaryBest~》2CD[24-96]flac
- Isgaard2003-GoldenKey(LimitedEdition)【WAV+CUE】
- 《合金装备3RE》伊娃定妆照公布:没被政确太好了
- 石家庄新增《黑神话:悟空》墙绘:小狐狸萍萍
- 贴吧热议:黑神话之后 你最希望国内什么题材游戏化
- 《降央卓玛 天下最美女中音 弦子》[WAV/分轨][310MB]
- 《40位至尊级歌手 广东经典101 VOL2 最爱恋曲 6CD》[WAV+CUE][2.9GB]
- 《杨钰莹 精选甜歌皇后28首歌曲 我在春天等你 2CD》[WAV/分轨][840MB]
- 祈愿:「焮火铸魂·希诺宁(岩)」概率UP!
- 【原神】V5.0攻略 | 世界任务「在应许与遗忘之间」系列
- 【原神】V5.0攻略 | 纳塔含成就每日委托——「小小人儿,快长大」
- 李家明.1992-不老的情人【新艺宝】【WAV+CUE】
- 以莉·高露.2015-美好時刻【风潮】【FLAC分轨】