vsftp账号_Linux入门-CentOS7安装vsftp
生活随笔
收集整理的這篇文章主要介紹了
vsftp账号_Linux入门-CentOS7安装vsftp
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前言
vsftpd是用于類Unix系統(包括Linux)的FTP服務器。那怎么搭建呢?請看下文在CentOS7 64位進行安裝。
為了調試順利,關閉selinux,防火墻iptables
一.yum安裝vsftp
# yum -y install vsftpd二.啟動服務
# systemctl start vsftpd.service三.配置文件
/etc/vsftpd/vsftpd.conf四.配置部署
1、備份配置文件,修改配置文件
# cd /etc/vsftpd/# cp vsftpd.conf vsftpd.conf.bak # echo '' > vsftpd.conf# vim /etc/vsftpd/vsftpd.conf2、配置文件內容(虛擬用戶必須關閉虛擬用戶anonymous_enable=NO)
anonymous_enable=NOwrite_enable=YESchroot_local_user=YESchroot_list_enable=YESuse_localtime=YESlocal_enable=YESallow_writeable_chroot=YESxferlog_enable=YESlocal_umask=022pam_service_name=vsftpd use_localtime=YESlisten_port=21chroot_local_user=YESidle_session_timeout=120 data_connection_timeout=120guest_enable=YESguest_username=ftpuser user_config_dir=/etc/vsftpd/vuser_confvirtual_use_local_privs=YES pasv_min_port=10060pasv_max_port=10090 accept_timeout=5connect_timeout=13、創建宿主用戶
- 創建用戶 ftpuser 指定 /home/vsftpd 目錄
- 設置用戶 ftpuser 的密碼
- 把 /home/vsftpd 的所有權給ftpuser.root
4、建立虛擬用戶文件
# touch /etc/vsftpd/vuser_passwd# 編輯虛擬用戶名單文件:(# 第一行賬號,第二行密碼,注意:不能使用root做用戶名,系統保留)# vi /etc/vsftpd/vuser_passwd # 編輯內容,下面是 vuser_passwd 內容ftp112345678ftp212345678保存退出
5、生成虛擬用戶數據文件
# db_load -T -t hash -f /etc/vsftpd/vuser_passwd /etc/vsftpd/vuser_passwd.db# chmod 600 /etc/vsftpd/vuser_passwd.db6、創建用戶配置
# mkdir /etc/vsftpd/vuser_conf # 建立虛擬用戶個人vsftp的配置文件# cd /etc/vsftpd/vuser_conf # 進入目錄# touch ftp1 ftp2每個文件(ftp1和ftp2寫入如下內容,local_root=/home/vsftpd/ftp1#這里寫入這個用戶的實際存儲路徑)
local_root=/home/vsftpd/ftp1write_enable=YESanon_world_readable_only=NOanon_upload_enable=YESanon_mkdir_write_enable=YESanon_other_write_enable=YES7、創建用戶目錄
# mkdir -p /home/vsftpd/ftp1# mkdir -p /home/vsftpd/ftp28、配置登錄用戶
# vi /etc/vsftpd/chroot_listftp1ftp29、服務啟動、停止、狀態命令
# systemctl restart vsftpd.service # 重啟服務# systemctl start vsftpd.service # 啟動服務# systemctl status vsftpd.service # 服務狀態查看10、生成虛擬用戶的PAM文件
# cd /etc/pam.d/備份vsftpd文件# cp vsftpd vsftpd.bak修改vsftpd文件內容(加入第二和第三行,下面的都全部注釋,注意下面是64位操作系統,如果是32位的話lib64需要改成lib)
#%PAM-1.0auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/vuser_passwdaccount required /lib64/security/pam_userdb.so db=/etc/vsftpd/vuser_passwd#session optional pam_keyinit.so force revoke#auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed#auth required pam_shells.so#auth include password-auth#account include password-auth#session required pam_loginuid.so#session include password-authCentos6 安裝遇到的問題
- Centos6 啟動vsftp服務命令
- Centos6 啟動報錯500 OOPS: unrecognised variable in config file: allow_writeable_chroot
查看版本
# vsftpd -versionvsftpd: version 2.2.2不支持,需要在配置文件/etc/vsftpd/vsftpd.conf屏蔽這個配置項
- Centos6 啟動報錯500 OOPS: vsftpd: not configured for standalone, must be started from inetd
需要在配置文件/etc/vsftpd/vsftpd.conf里新增
listen=yes加入收藏
總結
以上是生活随笔為你收集整理的vsftp账号_Linux入门-CentOS7安装vsftp的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 多进程进阶
- 下一篇: pip 删除安装包_Python中PIP