1. 程式人生 > >在suse11上安裝配置vsftpd,允許local的root和oracle使用者ftp

在suse11上安裝配置vsftpd,允許local的root和oracle使用者ftp

vsftp啟動模式分兩種,分別為standalone和xinetd方式。下面使用xinetd方式,下面是xinetd模式的配置。

•服務在xinetd中enable vsftpd,可以使用命令chkconfig vsftpd on ,下面是編輯/etc/xinetd.d/vsftpd檔案的方法。
# vi /etc/xinetd.d/vsftpd
修改該檔案下列幾項如下:
socket_type = stream
disable = no
即可
•修改vsftpd的配置檔案/etc/vsftpd.conf,使用local方式認證
# vi /etc/vsftpd.conf
把anonmous_enable=YES改成NO(禁掉匿名連結,不安全)
把local_enable=YES前的註釋去掉,開啟本地使用者連線的許可權,允許使用本機的oracle等使用者,還要修改/etc/ftpusers
把write_enable=YES前的註釋去掉,開啟本地使用者的寫許可權
把local_umask=022前的註釋去掉
註釋掉listen=YES
suse11預設為standalone,註釋掉listen=YES,關閉standalone模式,否則在啟動xinetd後,ftp時會報500錯誤。

•啟動xinetd
#/etc/init.d/xinetd start
使用xinetd方式啟動vsftp時,程序中看不到vsftp,21埠由xinetd監聽。

•編輯/etc/ftpusers 檔案,註釋掉root和oracle,這樣才能允許local的root和oracle使用者登入,否則ftp 127.0.0.1,輸入本地使用者和密碼,卻提示login faild!
#vi /etc/ftpusers
註釋掉oracle和root使用者
說明:suse11的pam中vsftpd的配置,/etc/ftpusers 中的使用者登入時會被拒絕。

suse1:/etc/pam.d # cat vsftpd
#%PAM-1.0

# Uncomment this to achieve what used to be ftpd -A.
# auth required pam_listfile.so item=user sense=allow file=/etc/ftpchroot onerr=fail

auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed

...