【轉】CentOS中vsftp安裝、配置、卸載

来源:http://www.cnblogs.com/objecttozero/archive/2016/04/10/centos_vsftpd.html
-Advertisement-
Play Games

1. 安裝VSFTP 1 yum -y install vsftpd 2. 配置vsftpd.conf文件 1 # Example config file /etc/vsftpd/vsftpd.conf 2 # 3 # The default compiled in settings are fai ...


1. 安裝VSFTP

1 yum -y install vsftpd
View Code

 

2. 配置vsftpd.conf文件

 

  1 # Example config file /etc/vsftpd/vsftpd.conf 
  2 # 
  3 # The default compiled in settings are fairly paranoid. This sample file 
  4 # loosens things up a bit, to make the ftp daemon more usable. 
  5 # Please see vsftpd.conf.5 for all compiled in defaults. 
  6 # 
  7 # READ THIS: This example file is NOT an exhaustive list of vsftpd options. 
  8 # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's 
  9 # capabilities. 
 10 # 
 11 # Allow anonymous FTP? (Beware - allowed by default if you comment this out). 
 12 #anonymous_enable=YES
 13 # 
 14 # Uncomment this to allow local users to log in. 
 15 local_enable=YES 
 16 # 
 17 # Uncomment this to enable any form of FTP write command. 
 18 write_enable=YES 
 19 # 
 20 # Default umask for local users is 077. You may wish to change this to 022, 
 21 # if your users expect that (022 is used by most other ftpd's) 
 22 local_umask=022 
 23 # 
 24 # Uncomment this to allow the anonymous FTP user to upload files. This only 
 25 # has an effect if the above global write enable is activated. Also, you will 
 26 # obviously need to create a directory writable by the FTP user. 
 27 #anon_upload_enable=YES 
 28 # 
 29 # Uncomment this if you want the anonymous FTP user to be able to create 
 30 # new directories. 
 31 #anon_mkdir_write_enable=YES 
 32 # 
 33 # Activate directory messages - messages given to remote users when they 
 34 # go into a certain directory. 
 35 dirmessage_enable=YES 
 36 # 
 37 # The target log file can be vsftpd_log_file or xferlog_file. 
 38 # This depends on setting xferlog_std_format parameter 
 39 xferlog_enable=YES 
 40 # 
 41 # Make sure PORT transfer connections originate from port 20 (ftp-data). 
 42 connect_from_port_20=YES 
 43 # 
 44 # If you want, you can arrange for uploaded anonymous files to be owned by 
 45 # a different user. Note! Using "root" for uploaded files is not 
 46 # recommended! 
 47 #chown_uploads=YES
 48  
 49 #chown_username=whoever 
 50 # 
 51 # The name of log file when xferlog_enable=YES and xferlog_std_format=YES 
 52 # WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log 
 53 #xferlog_file=/var/log/xferlog 
 54 # 
 55 # Switches between logging into vsftpd_log_file and xferlog_file files. 
 56 # NO writes to vsftpd_log_file, YES to xferlog_file 
 57 xferlog_std_format=YES 
 58 # 
 59 # You may change the default value for timing out an idle session. 
 60 idle_session_timeout=600 
 61 # 
 62 # You may change the default value for timing out a data connection. 
 63 data_connection_timeout=120 
 64 # 
 65 # It is recommended that you define on your system a unique user which the 
 66 # ftp server can use as a totally isolated and unprivileged user. 
 67 #nopriv_user=ftpsecure 
 68 # 
 69 # Enable this and the server will recognise asynchronous ABOR requests. Not 
 70 # recommended for security (the code is non-trivial). Not enabling it, 
 71 # however, may confuse older FTP clients. 
 72 #async_abor_enable=YES 
 73 # 
 74 # By default the server will pretend to allow ASCII mode but in fact ignore 
 75 # the request. Turn on the below options to have the server actually do ASCII 
 76 # mangling on files when in ASCII mode. 
 77 # Beware that on some FTP servers, ASCII support allows a denial of service 
 78 # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd 
 79 # predicted this attack and has always been safe, reporting the size of the 
 80 # raw file. 
 81 # ASCII mangling is a horrible feature of the protocol. 
 82 ascii_upload_enable=YES
 83 ascii_download_enable=YES
 84  
 85 # 
 86 # You may fully customise the login banner string: 
 87 ftpd_banner=Welcome to lightnear FTP service. 
 88 # 
 89 # You may specify a file of disallowed anonymous e-mail addresses. Apparently 
 90 # useful for combatting certain DoS attacks. 
 91 #deny_email_enable=YES 
 92 # (default follows) 
 93 #banned_email_file=/etc/vsftpd/banned_emails 
 94 # 
 95 # You may specify an explicit list of local users to chroot() to their home 
 96 # directory. If chroot_local_user is YES, then this list becomes a list of 
 97 # users to NOT chroot(). 
 98 chroot_local_user=YES 
 99 #chroot_list_enable=YES 
100 # (default follows) 
101 #chroot_list_file=/etc/vsftpd/chroot_list 
102 # 
103 # You may activate the "-R" option to the builtin ls. This is disabled by 
104 # default to avoid remote users being able to cause excessive I/O on large 
105 # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume 
106 # the presence of the "-R" option, so there is a strong case for enabling it. 
107 ls_recurse_enable=YES
108 # 
109 # When "listen" directive is enabled, vsftpd runs in standalone mode and 
110 # listens on IPv4 sockets. This directive cannot be used in conjunction 
111 # with the listen_ipv6 directive. 
112 listen=YES 
113 # 
114 # This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6 
115 # sockets, you must run two copies of vsftpd with two configuration files. 
116 # Make sure, that one of the listen options is commented !! 
117 #listen_ipv6=YES
118  
119 pam_service_name=vsftpd 
120 userlist_enable=YES 
121 userlist_deny=NO 
122 local_root=/var/public_root 
123 tcp_wrappers=YES
124 use_localtime=YES
View Code

 

3. 增加FTP帳戶

   這裡設置的賬戶名為“objectyan”,密碼為“objectyan

1 [root@localhost ~]# useradd objectyan -s /sbin/nologin
2 [root@localhost ~]# passwd objectyan
View Code

 

4. 編輯user_list文件,允許objectyan用戶訪問FTP

 1 [root@localhost ~]# vi /etc/vsftpd/user_list
 2 
 3 # vsftpd userlist
 4 # If userlist_deny=NO, only allow users in this file
 5 # If userlist_deny=YES (default), never allow users in this file, and
 6 # do not even prompt for a password.
 7 # Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
 8 # for users that are denied.
 9 root
10 bin
11 daemon
12 adm
13 lp
14 sync
15 shutdown
16 halt
17 mail
18 news
19 uucp
20 operator
21 games
22 nobody
23 objectyan
View Code

 

5. 建立我們的根目錄,並設置訪問許可權

1 [root@localhost ~]# mkdir /var/public_root
2 [root@localhost ~]# chown -R objectyan /var/public_root
3 [root@localhost ~]# chmod -R 755 /var/public_root
View Code

6. 開啟vsftpd服務

1 [root@localhost ~]# service vsftpd start
View Code

7.預設開啟vsftp服務

 

1 [root@localhost var]# chkconfig vsftpd on
View Code

 

centos 卸載vsftpd方法

    如果伺服器上安裝了vsftpd,配置出錯需要卸載vsftpd

 

1 [root@localhost ~]# rpm -aq vsftpd
View Code

 

  vsftpd-2.0.5-16.el5_5.1 #此處是查找vsftpd的返回結果

1 [root@localhost ~]# rpm -e vsftpd-2.0.5-16.el5_5.1
View Code

  #用rpm -e 查找結果 進行刪除就ok了。
  warning: /etc/vsftpd/user_list saved as /etc/vsftpd/user_list.rpmsave
  warning: /etc/vsftpd/ftpusers saved as /etc/vsftpd/ftpusers.rpmsave #刪除時將備份vsftp的用戶列表文件。

 

 

 

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 最近項目中需要用到一些視圖的某些邊界設置為圓角,比如指定一個長方形view,需要設置其左邊為圓形,所以就封裝一個類來實現指定邊界的圓角 1,首先創建一個繼承於UIView的分類(由於項目中我需設置一個button的圓角, 所以命名為Btn) 2.在介面文件中設置介面 這裡參數:distance 為需 ...
  • 在上一篇中我們雖然成功進入了保護模式,但是並沒有體驗到保護模式帶給我們的便利。其實在保護模式下定址空間可以達到4GB,實模式下1MB的定址能力差得太遠了。那麼下麵,我們就把程式稍作修改,體驗一下它對超過1MB記憶體的訪問能力。 我們來試驗一下讀寫大地址記憶體。在前面程式的基礎上,新建一個段,這個段以5M ...
  • 保持listview滑動的位置,一般用在增加listview子item中佈局的評論或者退出當前活動,再次進入繼續閱讀時。 利用ListView.getFirstVisiblePosition()來獲取當前可見的第一個Item的position,在滾動監聽中設置 其中存儲position和scroll ...
  • 大家可以先看這篇文章ASP.NET Redis 開發對Redis有個初步的瞭解 Redis的主從複製功能非常強大,一個master可以擁有多個slave,而一個slave又可以擁有多個slave,如此下去,形成了強大的多級伺服器集群架構. 實現步驟如下: 1.在Windows某個磁碟上創建兩個目錄, ...
  • 1、數據表的增刪改查操作(crud): 對於表: 增:create table XXXX 刪:drop table XXXX 改:alter table XXXX rename to XXXX 查:select * from XXXX 對於行: 增:insert into XXXX(xxxx) va ...
  • 模糊查詢 格式: select 欄位的集合 from 表名 where 某個欄位的名字 匹配的條件註意:匹配的條件通常含有通配符 1、% 表示任意零個或多個字元 select * from emp where ename like '%A%' --ename中間含A就輸出 select * from ...
  • 龍果學院 講師:吳水成 三、高可用架構篇 第13節--MySQL源碼編譯安裝(CentOS-6.6+MySQL-5.6) 第14節--MySQL主從複製的配置(CentOS-6.6+MySQL-5.6) 第15節--MyCat在MySQL主從複製基礎上實現讀寫分離 第16節--MyCat集群部署(H ...
  • 前幾天被老大訓斥連openrowset 都不會用,然後我就去看了文檔,想測試一下慄子~ openrowset 的具體語法我就不貼了,戳這裡:https://msdn.microsoft.com/zh-cn/library/ms190312(v=sql.120).aspx 按照文檔裡面的樣例來測試,首 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...