溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

vsftpd用戶配置 No.2

發(fā)布時間:2020-09-18 20:03:38 來源:網(wǎng)絡 閱讀:562 作者:laihuadongcto 欄目:網(wǎng)絡安全

在配置ftp虛擬用戶的過程中,還有一種配置方式。

yum -y install 安裝vsftpd

cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak


編輯vsftpd.conf

開啟下列選項:

anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=022

anon_mkdir_write_enable=NO

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

chown_uploads=NO

xferlog_file=/var/log/vsftpd.log

xferlog_std_format=YES

ascii_upload_enable=YES

ascii_download_enable=YES

ftpd_banner=Welcome to blah FTP service.

chroot_list_enable=YES

chroot_list_file=/etc/vsftpd/chroot_list

listen=YES

pam_service_name=vsftpd

userlist_enable=YES

tcp_wrappers=YES

use_localtime=YES

pasv_enable=YES

user_config_dir=/etc/vsftpd/vsftpd_user_conf

具體配置的注釋可以參考上篇文章的注釋。


因為我們上邊配置文件設置了用戶鎖定跟目錄:因此我們在配置文件目錄下創(chuàng)建的chroot_list 就是我們的ftp用戶。

touch chroot_list

在/etc/vsftpd/下創(chuàng)建用戶目錄

創(chuàng)建ftp用戶  useradd -m -d /home/test test -s /sbin/nologin   并設置密碼!

mkdir  vsftpd_user_conf  

cd vsftpd_user_conf  touch 用戶文件

cmds_allowed=FEAT,REST,CWD,LIST,MDTM,NLST,PASS,PASV,PORT,PWD,QUIT,RETR,SIZE,STOR,TYPE,USER,ACCT,APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST,MKD

最后我們在用戶文件中配置ftp用戶權限,重啟vsftpd服務即可!



這里插入一個權限的說明文檔,是我在網(wǎng)上找的!

              vsftpd cmds_allowed 權限控制

cmds_allowed=ABOR,CWD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RETR,RMD,RNFR…………

注意:一定不能使用換行和空格,不然就沒效果..

CWD - change working directory 更改目錄
LIST - list remote files 列目錄
MKD - make a remote directory 新建文件夾
NLST - name list of remote directory
PWD - print working directory 顯示當前工作目錄
RETR - retrieve a remote file 下載文件
STOR - store a file on the remote host 上傳文件

DELE - delete a remote file 刪除文件
RMD - remove a remote directory 刪除目錄
RNFR - rename from 重命名
RNTO - rename to 重命名

# ABOR - abort a file transfer 取消文件傳輸
# CWD - change working directory 更改目錄
# DELE - delete a remote file 刪除文件
# LIST - list remote files 列目錄
# MDTM - return the modification time of a file 返回文件的更新時間
# MKD - make a remote directory 新建文件夾
# NLST - name list of remote directory
# PASS - send password
# PASV - enter passive mode
# PORT - open a data port 打開一個傳輸端口
# PWD - print working directory 顯示當前工作目錄
# QUIT - terminate the connection 退出
# RETR - retrieve a remote file 下載文件
# RMD - remove a remote directory
# RNFR - rename from
# RNTO - rename to
# SITE - site-specific commands
# SIZE - return the size of a file 返回文件大小
# STOR - store a file on the remote host 上傳文件
# TYPE - set transfer type
# USER - send username


# less common commands:

# ACCT* - send account information
# APPE - append to a remote file
# CDUP - CWD to the parent of the current directory
# HELP - return help on using the server
# MODE - set transfer mode
# NOOP - do nothing
# REIN* - reinitialize the connection
# STAT - return server status
# STOU - store a file uniquely
# STRU - set file transfer structure
# SYST - return system type




向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI