VSFTPD 添加使用者

來源:互聯網
上載者:User

VSFTPD的安裝網上有很多教程這裡就不多說了,這裡主要是針對做主機空間服務的朋友在安裝好vsftpd後如何為使用者增加ftp帳號
先來看一看我們一般在*inux系統下面如何增加使用者的
#adduser 使用者名稱#passwd 使用者名稱斷行符號後系統會給出以下提示:
Changing password for user XX使用者名稱.
New password:
BAD PASSWORD: it does not contain enough DIFFERENT characters
Retype new password:
passwd: all authentication tokens updated successfully.
但像以上這樣增加使用者是不行的,加樣加出來的使用者為普通使用者,有系統登陸許可權,所以我要在adduser命令後後面加上參數,如下:
[root@srsman]# adduser -g ftp -s /sbin/nologin srsman
[root@srsman]# passwd beinan
Changing password for user beinan.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
這樣加出來的使用者也是普通使用者,但這個使用者是不能登入系統的,只能是登入FTP
通過上面的命令加的使用者系統會在/home目錄下建立一個同名的檔案夾,使用者FTP上來後指向的目錄也為此目錄,如何為ftp使用者指定到特定的目錄呢?
命令如下:
[root@srsman]# adduser -d /opt/srsman -g ftp -s /sbin/nologin srsman
[root@srsman]# passwd srsman
Changing password for user beinan.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
這樣就為系統增加了一個名為srsman,目錄指向為/opt/srsman的ftp使用者
    Tips:很多朋友在增加使用者後ftp上伺服器的時候總是提示
ftp伺服器串連失敗,錯誤提示:
500 OOPS: cannot change directory:/home/*******
500 OOPS: child died
當你看到以上提示時,試著在輸入以下命令解決
setsebool -P ftpd_disable_trans 1
service vsftpd restart
第一行中的-P參數是為了以後不需要每次開機都輸入這個命令
//===================================================================
修改vsftpd.conf檔案:
user_config_dir=/etc/vsftpd/user_config_dir
並在這個檔案夾下面添加使用者名稱的檔案
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
//===================================================================
修改檔案夾的讀寫權限:
chown ftp /var/ftp/upload
chmod 777 /var/ftp/upload
//====================================================================

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.