首頁  >  文章  >  運維  >  linux中ftp登入不了怎麼辦

linux中ftp登入不了怎麼辦

WBOY
WBOY原創
2022-05-23 16:22:555405瀏覽

方法:1、用「yum -y install vsftpd」安裝vsftpd;2、用「chkconfig iptables off」關閉防火牆;3、修改vsftp檔案允許root使用者登入;4、修改config中disabled模式並重啟即可。

linux中ftp登入不了怎麼辦

本教學操作環境:linux7.3系統、Dell G3電腦。

linux中ftp登入不了怎麼辦

1、先安裝vsftpd

指令:

yum -y install vsftpd

之後開啟服務:

service vsftpd start

2、關閉防火牆

1) 重新啟動後生效

開啟:

chkconfig iptables on

關閉:

chkconfig iptables off

2) 即時生效,重啟後失效

開啟:

service iptables start

關閉:

service iptables stop

3、預設vsftp是不允許root使用者登入的,可以透過修改限制來解決這個問題

先找到vsftp的設定目錄

[root@localhost vsftpd]# pwd
/etc/vsftpd
[root@localhost vsftpd]# ls
chroot_list  ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh
[root@localhost vsftpd]#
修改
[root@localhost vsftpd]# cat ftpusers
# Users that are not allowed to login via ftp
#root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
修改
[root@localhost vsftpd]# cat user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
#root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

上面這個兩個就是預設vsftp不允許使用的帳號列表,講文件中root刪除,或前面加#號重啟一下vsftpd 服務即可

4、將/etc/selinux/config 中的enforcing 模式改為disabled, 然後重啟

推薦學習:Linux影片教學

#

以上是linux中ftp登入不了怎麼辦的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn