當前位置:首頁 » 文件管理 » ftp服務ubuntu

ftp服務ubuntu

發布時間: 2024-06-13 18:57:08

❶ [翻譯]在 Ubuntu 中使用 SSL/TLS 加密 ftp 連接

在本教程中,我們將介紹如何在 Ubuntu 16.04 / 16.10 中使用 SSL / TLS 加密 FTP(本文中,我們將使用 VsFTP,一個號稱非常安全的 FTP 軟體)

在完成本指南中的所有步驟之後,我們將進一步去了解在FTP伺服器中啟用加密服務的基本原理,以確保能安全的傳輸數據。

      必須在 Ubuntu中已經安裝並配置完FTP伺服器

請確保本文中的所有命令都將以root或sudo特權帳戶運行。

1.我們將首先在 /etc/ssl/ 下創建一個子目錄(如果這個目錄不存在),以存儲SSL / TLS證書和密鑰文件:

2.現在,我們通過運行下面的命令在單個文件中生成證書和密鑰。

上述命令將提示您回答以下問題,請輸入自己特定的值。

3.在進行任何 VsFTP 配置之前,對於啟用了UFW防火牆的用戶,必須打開埠990和40000-50000,以允許在VSFTPD配置文件中分別設置TLS連接和被動埠的埠范圍:

4.現在,打開VSFTPD配置文件並在其中定義SSL詳細信息:

然後,添加或找到選項 ssl_enable 並將其值設置為 YES 以激活 SSL 的使用,因為 TLS 比 SSL 更安全,因此通過啟用 ssl_tlsv1 選項,我們將限制 VSFTPD 使用 TLS:

5.接下來,使用 # 字元注釋掉下面的行,如下所示:

6.現在,我們還必須防止匿名用戶使用SSL,然後強制所有非匿名登錄使用安全的SSL連接進行數據傳輸,並在登錄期間發送密碼:

7.此外,我們可以使用以下選項在FTP伺服器中添加更多的安全功能。使用option_ssl_reuse = YES選項,所有SSL數據連接都需要展示SSL會話重用;證明他們知道與控制頻道相同的主機密碼。所以我們應該禁用它。

另外,我們可以通過設置 ssl_ciphers 選項來設置SSL密碼等級。這將有助於阻擋試圖強制使用特定密碼的攻擊。

8.然後,我們來定義被動埠的埠范圍(最小和最大埠)。

9.我們可以使用debug_ssl選項啟用SSL調試,將 openSSL 連接記錄到VSFTPD日誌文件中:

最後保存並關閉文件。然後重啟 VSFTPD 服務:

10.執行上述所有配置後,通過從命令行使用FTP來測試VSFTPD是否正在使用SSL / TLS連接。

在下面的輸出,有一個錯誤消息,VSFTPD 只允許用戶(非匿名)從支持加密服務的安全客戶端登錄。

因為命令行不支持加密服務,從而導致了上述錯誤。因此,為了安全地連接到啟用加密服務的FTP伺服器,我們需要一個默認支持 SSL / TLS 連接的FTP客戶端,例如FileZilla。

FileZilla是功能強大,廣泛使用的跨平台FTP客戶端,支持通過SSL / TLS等方式連接 FTP。要在linux客戶端計算機上安裝FileZilla,請使用以下命令。

12.安裝完成後,打開它並轉到File => Sites Manager或按 Ctrl + S 以打開下面的站點管理器界面。

13.現在,添加主機/站點名稱和IP地址,定義要使用的協議,加密和登錄類型,如下面的屏幕截圖(使用適用於您的實際情況的值):

14.然後點擊從上面的「Connect」,輸入密碼,然後驗證用於SSL / TLS連接的證書,然後單擊「確定」再次連接到FTP伺服器:

15.現在,您應該已經通過TLS連接成功登錄到了FTP伺服器,可以從下面的界面查看連接狀態以獲取更多信息。

16.最後,我們將文件從本地機器傳輸到FTP伺服器的文件夾中,看看FileZilla界面的下端,查看有關文件傳輸的報告。

全部教程如上!永遠記住,安裝FTP伺服器而不啟用加密服務具有一定的安全隱患。正如我們在本教程中所述,您可以在 Ubuntu 16.04 / 16.10中配置FTP伺服器以使用SSL / TLS來實現安全連接。

❷ ubuntu linux 下如何啟動ftp服務

Linux下開啟FTP服務方法:
1. 檢測FTP服務是否開啟
通過查詢提供FTP服務的進程是否存在

Shell代碼
ps -ef | grep ftp
並未找到任何包含ftp關鍵字的進程信息,可判斷服務未開啟。
通過查詢是vsftpd服務是否存在
Shell代碼
service vsftpd status
vsftpd是最常見的FTP伺服器,一般Linux系統都是通過vsftpd來搭建FTP服務環境。發現處stopped狀態。
2. 開啟FTP服務
Shell代碼
service vsftpd start
成功開啟並顯示出pid(進程ID)為3401。再查下vsftpd開啟狀態已經顯示running。
再通過查詢包含ftp關鍵字的進程信息,發現也找到一個進程ID為3401的FTP進程。
3. 簡單配置實現匿名上傳下載
默認開啟的vsftpd服務對匿名用戶是不開放上傳許可權的。可修改vsftpd目下的配置文件vsftpd.conf來開發許可權。設置的方法就是取消對該行的注釋即可(換句話說就是把前面#號刪除就好)。

❸ ubuntu ftp命令put怎麼用

FTP連接

1
打開終端, 滑鼠點擊, 或者輸入快捷鍵(Ctrl+Alt+T)

2
Linux ftp命令的一般格式如下:$ ftp 主機名/IP,其中「主機名/IP」是所要連接的遠程機的主機名或IP地址。在命令行中,主機名屬於選項,如果指定主機名,ftp將試圖與遠程機的ftp服務程序進行連接;

3
如果沒有指定主機名,ftp將給出提示符,等待用戶輸入命令:$ ftp,ftp >,此時在ftp>提示符後面輸入open命令加主機名或IP地址,將試圖連接指定的主機。

4
不管使用哪一種方法,如果連接成功,需要在遠程機上登錄。用戶如果在遠程機上有帳號,就可以通過ftp使用這一帳號並需要提供口令。在遠程機上的用戶帳號的讀寫許可權決定該用戶在遠程機上能下載什麼文件和將上載文件放到哪個目錄中

END
FTP命令

最常用的命令有:
ls 列出遠程機的當前目錄
cd 在遠程機上改變工作目錄
lcd 在本地機上改變工作目錄
ascii 設置文件傳輸方式為ASCII模式
binary 設置文件傳輸方式為二進制模式
close 終止當前的ftp會話
hash 每次傳輸完數據緩沖區中的數據後就顯示一個#號
get(mget) 從遠程機傳送指定文件到本地機
put(mput) 從本地機傳送指定文件到遠程機
open 連接遠程ftp站點
斷開與遠程機的連接並退出ftp

❹ ubuntu下如何配置FTP

一.vsftpd說明:
LINUX下實現FTP服務的軟體很多,最常見的有vsftpd,Wu-ftpd和Proftp等.Red Hat Enterprise Linux中默認安裝的是vsftpd.
訪問FTP伺服器時需要經過驗證,只有經過了FTP伺服器的相關驗證,用戶才能訪問和傳輸文件.vsftpd提供了3種ftp登錄形式:
(1)anonymous(匿名帳號)
使用anonymous是應用廣泛的一種FTP伺服器.如果用戶在FTP伺服器上沒有帳號,那麼用戶可以以anonymous為用戶名,以自己的電子郵件地址為密碼進行登錄.當匿名用戶登錄FTP伺服器後,其登錄目錄為匿名FTP伺服器的根目錄/var/ftp.為了減輕FTP伺服器的負載,一般情況下,應關閉匿名帳號的上傳功能.
(2)real(真實帳號)
real也稱為本地帳號,就是以真實的用戶名和密碼進行登錄,但前提條件是用戶在FTP伺服器上擁有自己的帳號.用真實帳號登錄後,其登錄的目錄為用戶自己的目錄,該目錄在系統建立帳號時系統就自動創建.
(3)guest(虛擬帳號)
如果用戶在FTP伺服器上擁有帳號,但此帳號只能用於文件傳輸服務,那麼該帳號就是guest,guest是真實帳號的一種形式,它們的不同之處在於,geust登錄FTP伺服器後,不能訪問除宿主目錄以外的內容.

二.FTP相關配置文件說明
其相關配置文件有/etc/vsftpd/vsftpd.conf, /etc/vsftpd.ftpusers, /etc/vsftpd.user_list,在配置FTP伺服器時,主要是修改這些文件中的相關語句.
1.vsftpd.conf文件說明
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES //是否允許anonymous登錄FTP伺服器,默認是允許的.
#
# Uncomment this to allow local users to log in.
local_enable=YES //是否允許本地用戶登錄FTP伺服器,默認是允許
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES //是否允許用戶具有在FTP伺服器文件中執行寫的許可權,默認是允許
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022 //設置本地用戶的文件生成掩碼為022,默認是077
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES //是否允許匿名賬戶在FTP伺服器中創建目錄
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES //激活目錄信息,當遠程用戶更改目錄時,將出現提示信息
#
# Activate logging of uploads/downloads.
xferlog_enable=YES //啟用上傳和下載日誌功能
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES //啟用FTP數據埠的連接請求
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log //設置日誌文件的文件名和存儲路徑,這是默認的
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES//是否使用標準的ftpd xferlog日誌文件格式
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600 //設置空閑的用戶會話中斷時間,默認是10分鍾
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120//設置數據連接超時時間,默認是120秒.
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES //是否允許使用ASCII格式來上傳和下載文件
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.//在FTP伺服器中設置歡迎登錄的信息.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES //如果希望用戶登錄後不能切換到自己目錄以外的其它目錄,需要設置該項,如果設置chroot_list_enable=YES,那麼只允許/etc/vsftpd.chroot_list中列出的用戶具有該功能.如果希望所有的本地用戶都執行者chroot,可以增加一行:chroot_local_user=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
pam_service_name=vsftpd //設置PAM認證服務的配置文件名稱,該文件存放在/etc/pam.d/目錄下.
userlist_enable=YES //用戶列表中的用戶是否允許登錄FTP伺服器,默認是不允許
#enable for standalone mode
listen=YES //使vsftpd 處於獨立啟動模式
tcp_wrappers=YES //使用tcp_wrqppers作為主機訪問控制方式
2.vsftpd.ftpusers文件說明
這個文件是用來記錄"不允許"登錄到FTP伺服器的用戶,通常是一些系統默認的用戶.
下面是該文件中默認的不允許登錄的名單:
# Users that are not allowed to login via ftp
root //默認情況下,root和它以下的用戶是不允許登錄FTP伺服器的.可以將不允許登錄的用戶添加到這里來.但切記每個用戶都要單獨佔用一行.
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
3.vsftpd.user_list文件說明
其實它的內容跟上面那個文件內容一樣,只是在系統對文件vsftpd.conf 進行檢測時,會檢測到"userlist_deny=YES",因此這個文件必須存在.下面是這個文件的內容.
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers
# for users that are denied.
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

❺ ubuntu linux 下如何啟動ftp服務

1、首先,連接相應linux主機,進入到linux命令行狀態下,等待輸入shell指令。

熱點內容
二維otsu演算法 發布:2024-10-22 21:06:23 瀏覽:634
福祿壽源碼 發布:2024-10-22 21:06:13 瀏覽:434
pythongoagent 發布:2024-10-22 20:42:05 瀏覽:78
matlabpid演算法 發布:2024-10-22 20:37:51 瀏覽:332
文件遍歷編程 發布:2024-10-22 20:37:47 瀏覽:622
nip伺服器地址在哪 發布:2024-10-22 20:17:48 瀏覽:621
戶戶通衛星鍋出廠設置密碼是什麼 發布:2024-10-22 20:11:32 瀏覽:759
怎麼將伺服器的文件導出來 發布:2024-10-22 20:09:13 瀏覽:556
直播秀場源碼 發布:2024-10-22 20:08:22 瀏覽:751
php遠程資料庫 發布:2024-10-22 20:03:05 瀏覽:730