29 · Securing Administrative Access保護管理存取安全

Configuring the Login Banner設定登入橫幅

You can define a customized login banner to be displayed before the username and password login prompts. Three different types of banners exist: Login banner, MOTD banner and Exec banner.

你可以定義自訂的登入橫幅,在使用者名稱與密碼登入提示前顯示。橫幅共有三種類型:登入橫幅(Login banner)、每日訊息橫幅(MOTD banner)與執行橫幅(Exec banner)。

The following table shows their use case and message examples.

下表顯示各類型的使用情境與訊息範例。

Banner Type
橫幅類型
Usage
用途
Example Message
訊息範例
Login banner
登入橫幅
It is used to display a warning or message when you try to log in to the device.
用於在你嘗試登入裝置時顯示警告或訊息。
Access for authorized users only. Please enter your username and password.
僅限已授權使用者存取。請輸入你的使用者名稱與密碼。
MOTD banner
每日訊息橫幅
It is used to display a message to the users that are connecting.
用於向正在連線的使用者顯示訊息。
$(hostname) will be under maintenance on May 4th. Connectivity issues may be present.
$(hostname) 將於 5 月 4 日進行維護,屆時可能出現連線問題。
Exec banner
執行橫幅
The exec message is displayed after your credentials have been approved. This banner will be shown after the login process.
執行訊息會在你的憑證通過驗證後顯示,此橫幅會在登入流程之後出現。
Welcome to Router1. Please remember to save all of your changes.
歡迎使用 Router1,請記得儲存你所做的所有變更。

Configure the login banner.

設定登入橫幅。

Switch(config)# banner login "Access for authorized users only. Please enter your username and password."

A user connecting to the device sees the following message:

連線至該裝置的使用者會看到以下訊息:

Access for authorized users only. Please enter your username and password.
User Access Verification
Username:

To configure a login banner, use the banner login command in global configuration mode. Enclose the banner text in quotation marks or use a delimiter that is different from any character appearing in the banner string.

若要設定登入橫幅,請在全域設定模式下使用 banner login 指令。將橫幅文字以引號括住,或使用不會出現在橫幅字串中的分隔符號。

To define and enable a message-of-the-day (MOTD) banner, use the banner motd command in global configuration mode.

若要定義並啟用每日訊息(MOTD)橫幅,請在全域設定模式下使用 banner motd 指令。

Router1(config)# banner motd "

$(hostname) will be under maintenance on May 4th. Connectivity issues may be present.

"

A user connecting to the device sees the following message (note that in example the login banner is also configured):

連線至該裝置的使用者會看到以下訊息(請注意,此範例中也設定了登入橫幅):

Router1 will be under maintenance on May 4th. Connectivity issues may be present.

Access for authorized users only. Please enter your username and password.
User Access Verification  
Username:

This MOTD banner is displayed to all terminals that are connected and is useful for sending messages that affect all users (such as impending system shutdowns).

此每日訊息橫幅會顯示給所有已連線的終端機,適合用於發送影響所有使用者的訊息(例如即將進行的系統關機)。

To define and enable Exec banner, use the banner exec command in global configuration mode. The exec banner is displayed to users who have successfully logged in to the device.

若要定義並啟用執行橫幅,請在全域設定模式下使用 banner exec 指令。執行橫幅會顯示給已成功登入裝置的使用者。

Router1(config)# banner exec "Welcome to Router1. Please remember to save all of your changes."

A user successfully authenticating to the device sees the following message:

成功通過裝置驗證的使用者會看到以下訊息:

Username: cisco
Password: 

Welcome to Router1. Please remember to save all of your changes.
Router1>
Which of the following is not true in regards to the login banner?關於登入橫幅,以下哪一項正確?