useradd -s /sbin/nologin -d /home/ftp_test ftp_test目錄盡量不要選擇根目錄下,這裡是/home/ftp_test,並且ftp_test這個目錄不要手動建立,否則許可權會有問題,執行命令的時候會自動建立,
可以看到許可權現在是對於ftp_test使用者是可讀可寫可執行的,其他使用者和組下面的都沒有任何許可權,現在為ftp_test使用者建立密碼:
passwd ftp_test執行之後輸入2次密碼確認就設定好了密碼
然後編輯vsftpd配置檔案,位置是:vim /etc/vsftpd/vsftpd.conf
找到anonymous_enable這個配置項,預設是yes,修改成no,表示不允許匿名使用者登入
現在直接儲存配置檔案,執行 systemctl start vsftpd.service 啟動vsftp服務,然後可以通過命令: systemctl status vsftpd.service 檢視ftp服務的執行狀態,現在就可以用ftp客戶端進行連線了,這裡用filezilla測試,連線正常
配置完這兩項以後儲存退出,然後執行 systemctl restart vsftpd.service 重啟vsftpd服務,現在重新使用ftp連線就成功了,並且任何操作也是沒問題的
現在可以看到上面的路徑是乙個/,對於ftp使用者來說也就是根目錄了,只能在這個目錄下操作,而無法跳出這個目錄
以上就是vsftpd服務的基本搭建過程,實際使用時可以分配多個使用者
快速搭建指令碼(適用centos7):
#!/bin/bash#author:template
#time:
20180802
. /etc/init.d/functions
stty erase ^h
yum -y install
vsftpd
read -p "
請輸入ftp使用者名稱:
"ftp_user
read -s -p "
請輸入ftp賬戶密碼:
"password
useradd -s /sbin/nologin $ftp_user
echo $password | passwd --stdin $ftp_user &> /dev/null
mv /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
cat >> /etc/vsftpd/vsftpd.conf <
anonymous_enable=no
local_enable=yes
write_enable=yes
local_umask=022
dirmessage_enable=yes
xferlog_enable=yes
connect_from_port_20=yes
xferlog_std_format=yes
chroot_local_user=yes
listen=no
listen_ipv6=yes
pam_service_name=vsftpd
userlist_enable=yes
allow_writeable_chroot=yes
eofsystemctl start vsftpd &&
useradd -s /sbin/nologin -d /home/ftp_test ftp_test目錄盡量不要選擇根目錄下,這裡是/home/ftp_test,並且ftp_test這個目錄不要手動建立,否則許可權會有問題,執行命令的時候會自動建立,
可以看到許可權現在是對於ftp_test使用者是可讀可寫可執行的,其他使用者和組下面的都沒有任何許可權,現在為ftp_test使用者建立密碼:
passwd ftp_test執行之後輸入2次密碼確認就設定好了密碼
然後編輯vsftpd配置檔案,位置是:vim /etc/vsftpd/vsftpd.conf
找到anonymous_enable這個配置項,預設是yes,修改成no,表示不允許匿名使用者登入
現在直接儲存配置檔案,執行 systemctl start vsftpd.service 啟動vsftp服務,然後可以通過命令: systemctl status vsftpd.service 檢視ftp服務的執行狀態,現在就可以用ftp客戶端進行連線了,這裡用filezilla測試,連線正常
配置完這兩項以後儲存退出,然後執行 systemctl restart vsftpd.service 重啟vsftpd服務,現在重新使用ftp連線就成功了,並且任何操作也是沒問題的
現在可以看到上面的路徑是乙個/,對於ftp使用者來說也就是根目錄了,只能在這個目錄下操作,而無法跳出這個目錄
以上就是vsftpd服務的基本搭建過程,實際使用時可以分配多個使用者
快速搭建指令碼(適用centos7):
#!/bin/bash#author:template
#time:
20180802
. /etc/init.d/functions
stty erase ^h
yum -y install
vsftpd
read -p "
請輸入ftp使用者名稱:
"ftp_user
read -s -p "
請輸入ftp賬戶密碼:
"password
useradd -s /sbin/nologin $ftp_user
echo $password | passwd --stdin $ftp_user &> /dev/null
mv /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
cat >> /etc/vsftpd/vsftpd.conf <
anonymous_enable=no
local_enable=yes
write_enable=yes
local_umask=022
dirmessage_enable=yes
xferlog_enable=yes
connect_from_port_20=yes
xferlog_std_format=yes
chroot_local_user=yes
listen=no
listen_ipv6=yes
pam_service_name=vsftpd
userlist_enable=yes
allow_writeable_chroot=yes
eofsystemctl start vsftpd &&
docker快速搭建FTP服務
1.安裝docker和docer compose略 2.docker compose file配置 將以下內容填充到ftp server.yml檔案中 配置說明 假設使用者使用者為ftp,上傳檔案到宿主機本地目錄為 var www upload,可根據需要修改yml檔案 version 2 serv...
快速搭建FTP伺服器
1.2 程式介面找到 啟用或關閉windows功能 並開啟 1.3 上面兩步也可以簡化為一步 按 win r 快捷鍵開啟執行對話方塊,輸入 optionalfeatures 後,按回車鍵 1.4 從 啟用或關閉windows功能 彈窗中找到internet information services ...
Ubuntu 16 04 快速搭建ftp服務
1 安裝vsftpd服務sudo apt get install vsftpd 2 啟動vsftpd服務sudo service vsftpd start 重啟vsftpd服務 sudo service vsftpd restart 檢視服務狀態 sudo service vsftpd status...