欧美日日操,日日爱网站,99久久久久久久,日本高清不卡免费,久久免费观看国产精品,秋霞在线观看视频一区二区三区

始創于2000年 股票代碼:831685
咨詢熱線:0371-60135900 注冊有禮 登錄
  • 掛牌上市企業
  • 60秒人工響應
  • 99.99%連通率
  • 7*24h人工
  • 故障100倍補償
您的位置: 網站首頁 > 幫助中心>文章內容

vsftpd本地用戶不能登錄問題的解決

發布時間:  2012/8/11 11:23:53
 打開/etc/selinux/config

將selinux=enforcing或permissive改成disabled。

記得要重新啟動服務器!

當然還要確定以下問題:

1,用戶是否被vsftpd限制登錄,比如用戶名在/etc/ftpusers中,并被阻止登錄了

2,vsftpd.conf中是否打開了pam認證的選項(自己編譯安裝的時候常因為這個出錯)(看vsftpd.conf中是否有pam_service_name=ftp或vsftpd.到底是哪個要看

PAM模塊的服務文件/etc/pam.d下是誰.我的是ftp且它的配置如下:

#%PAM-1.0
authrequired/lib/security/pam_listfile.soitem=usersense=denyfile=/etc/ftpusersonerr=succeed
authrequired/lib/security/pam_unix.soshadownullok
authrequired/lib/security/pam_shells.so
accountrequired/lib/security/pam_unix.so
sessionrequired/lib/security/pam_unix.so
如果/etc/ftpusers有的用戶將被deny

3,相關文件夾的權限是否正確.

關于“vsftpd部分本地用戶不能登錄,部分可以”的問題,

系統中原來就有的本地帳號都不能登錄,我的/etc/vsftpd/vsftpd.conf文件的配置如下:

local_enable=YES
write_enable=YES
chroot_local_user=YES
pam_service_name=vsftpd
/etc/pam.d/vsftpd存在且正常。

登錄時錯誤信息都是一樣的:

500OOPS:cannotchangedirectory:/home/xxxx
Loginfailed.
421Servicenotavailable,remoteserverhasclosedconnection

他們的home目錄都是/home/xxxx。/home和/home/xxxx的權限都是755。

以上這些帳號都不能ftp登錄,這些都是平常經常使用的,可以用shell登錄的。

我新創建了一個usr1帳號

#useradd-Gtest-d/tmp/usr1usr1

能ftp登錄,他的home為/tmp/usr1,在/分區上。而/home我是mount到/dev/hda9上的。

#mount
/dev/hdb1on/typeext3(rw)
/dev/hda9on/hometypeext2(rw)

所以,我猜想:是否是由于/home分區的原因,而造成“主目錄在/home分區的帳號”都不能登錄呢?

為了驗證以上設想,我試著再創建了一個帳號

useradd-Gtest-d/home/usr3usr3

/home,/home/usr3的權限都是755。

usr3ftp登錄失敗。

500OOPS:cannotchangedirectory:/home/usr3

Loginfailed.

421Servicenotavailable,remoteserverhasclosedconnection

至此,我覺得可以確定是由于/home分區的原因,而造成“主目錄在/home分區的帳號”都不能登錄。

參考文章:

IfinishedmysecondupgradetoFedoraCore4.Noteverythingisironedoutyetwiththebuildofcourse.ButonethingisforsurealothashappenedtotheRedHatIknewbefore.

Imustsayofallthechanges,formethenicestadditionisthenewSELinuxextensions.FordeepbackgroundonthereasonsforandtheoryofSELinuxread,TheInevitabilityofFailure:TheFlawedAssumptionofSecurityinModernComputingEnvironments

ThemoreIworkwithSELinuxthemoreIrealizeIneedtoknowaboutit,andhowexactlyitdoesallitsstuff.Itcertainlychangesthingsrelatingtousers,directoriesandaccess.AsIamstartingtolearnit,I'msureI'mdoingthingsthehard-way.:)

Themajordifference,sofarforme,inRedHat'sSELinuxisthewayftpishandled.vsftpdisstilltheserverwhichisgreat.However,itseemstobedesignedtorunasadaemonratherthaninvokedviaxinet.d.Ifyougrabaworkingcopyofthexinet.dfileforvsftpdyoucaninvokeitviaxinet.dwrapper.Ididmyfirstserverupgradeinthismanner.ThecurrentoneIamtryingasadaemon.IcertainlythinkIwillmisssomeofthefeaturesthatthexinet.dwrapperbrings,andmayyetreturntoit.

OfalltheissuesIsawmostnotableisifyouwanttoenablechrootdirectory'soutsideofthenormal/home/xxxvsftpd.Thesewillfailwitha

500OOPS:cannotchangedirectory:/mnt/xxxxx

IwasabletouseftpifIloggedinwithanaccountwithadirectoryin/home,butonceIsetauseraccounttohaveahomedriveoutsideof/home(inthiscaseonamountedsecondarydisk)vsftpdbarfstheabove.

IfoundinformationattheNSAthatindicatesyoucandisableSELinuxprotectionoftheftpdaemon.

setsebool-Pftpd_disable_trans1

Thisseemsabitdrastic.Itcertainlyworksfornowthough.

Ithinkultimatelytheissueresideswithpolicies,butasSELinuxpoliciesarenewtome,itwilltaketimebeforeitallgetssortedout.AsIspendtimewiththenewSELinuxextensionsinFedoraCore4Iwillkeepyouupdatedonmythoughtsandconfigurationlessons.

解決辦法:

#setseboolftpd_disable_trans1

#servicevsftpdrestart

我用的是FC4,按照你上一帖子里的方法試了,馬上就解決了。所以,可以確定原因就在SELinux。


本文出自:億恩科技【www.sunshares.net】

服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經營性ICP/ISP證:贛B2-20080012
  • 服務器/云主機 24小時售后服務電話:0371-60135900
  • 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
  • 專注服務器托管17年
    掃掃關注-微信公眾號
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權所有  地址:鄭州市高新區翠竹街1號總部企業基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網安備41019702002023號
      0
     
     
     
     

    0371-60135900
    7*24小時客服服務熱線