
可能是一個愚蠢的問題,但是當連接到 FTP 伺服器時,有時會有一個帳戶選項。這與用戶名相比有什麼意義?
例如,請從 Apache FTP 用戶端查看此方法:
/**
* Login to the FTP server using the provided username, password,
* and account. If no account is required by the server, only
* the username and password, the account information is not used.
*
* @param username The username to login under.
* @param password The password to use.
* @param account The account to use.
* @return True if successfully completed, false if not.
* @throws FTPConnectionClosedException
* If the FTP server prematurely closes the connection as a result
* of the client being idle or some other reason causing the server
* to send FTP reply code 421. This exception may be caught either
* as an IOException or independently as itself.
* @throws IOException If an I/O error occurs while either sending a
* command to the server or receiving a reply from the server.
*/
public boolean login(final String username, final String password, final String account)
throws IOException
{
....
}
答案1
「帳戶」在某些特定係統中很少使用(如果有的話)。你就會知道什麼時候需要使用它。大多數情況下你不知道。這可能是一些遺留的東西。畢竟FTPRFC 959定義「帳戶」功能是從 1985 年開始的!
ACCT
這是 FTP RFC 959 中關於(account) 指令的含糊說法:
參數欄位是標識使用者帳戶的 Telnet 字串。該命令不一定與 USER 命令相關,因為某些網站可能需要帳戶才能登錄,而其他網站可能只需要特定存取(例如儲存檔案)。在後一種情況下,命令可能隨時到達。