這篇文章主要介紹“selinux導(dǎo)致ftp上傳失敗如何解決”,在日常操作中,相信很多人在selinux導(dǎo)致ftp上傳失敗如何解決問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”selinux導(dǎo)致ftp上傳失敗如何解決”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!
成都創(chuàng)新互聯(lián)公司是一家專注于成都做網(wǎng)站、網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設(shè)與策劃設(shè)計(jì),曲沃網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設(shè)10多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:曲沃等地區(qū)。曲沃做網(wǎng)站價(jià)格咨詢:18980820575
1、手動(dòng)的執(zhí)行ftp上傳動(dòng)作,報(bào)如下錯(cuò)誤: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家目錄,肯定是有讀寫權(quán)限的,因?yàn)槭谴鞵C重啟導(dǎo)致的,突然想到selinux若開啟的話,是不允許用戶的家目錄進(jìn)行ftp的,需要將ftp_home_dir這個(gè)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、這時(shí)候去上傳,就可以成功了,如下所示
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設(shè)置為Permissive
[root@squid ~]# getenforce
Enforcing
[root@squid ~]# setenforce 0
[root@squid ~]# getenforce
Permissive
5、同時(shí)在/etc/rc.local中添加這么一行,那么下次系統(tǒng)重啟后,就不會(huì)發(fā)生這樣的情況了
[root@squid ~]# which setenforce
/usr/sbin/setenforce
[root@squid ~]# cat /etc/rc.local | tail -n 1
/usr/sbin/setenforce 0
到此,關(guān)于“selinux導(dǎo)致ftp上傳失敗如何解決”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!
新聞標(biāo)題:selinux導(dǎo)致ftp上傳失敗如何解決
網(wǎng)站鏈接:http://sd-ha.com/article30/jgihpo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、App開發(fā)、搜索引擎優(yōu)化、全網(wǎng)營(yíng)銷推廣、自適應(yīng)網(wǎng)站、微信小程序
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)