16
4.
Enter
s
.
A terminal session is started.
<Sysname>
%Mar 2 18:40:27:981 2011 Sysname SHELL/5/LOGIN: Console login from aux0
auto-execute command
CAUTION:
After configuring this command for a user interface, you might be unable to access the CLI through the
user interface. Make sure you can access the CLI through a different user interface before you configure
this command and save the configuration.
Use
auto-execute command
to specify a command to be automatically executed when a user logs in to
the current user interface.
Use
undo auto-execute command
to remove the configuration.
Syntax
auto-execute command
command
undo auto-execute command
Default
Command auto-execution is disabled.
Views
User interface view
Default command level
3: Manage level
Parameters
command
: Specifies the command to be automatically executed.
Usage guidelines
This command is not supported on AUX interfaces.
The system automatically executes the specified command when a user logs in to the user interface, and
tears down the user connection after the command is executed. If the command triggers another task, the
system does not tear down the user connection until the task is completed.
The command auto-execute function is typically used for redirecting a Telnet user to a specific host. After
executing the specified command and performing the incurred task, the system automatically disconnect
the Telnet session.
Examples
# Configure the device to automatically Telnet to 192.168.1.41
after a user logs in to interface VTY 0.
<Sysname> system-view
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname -ui-vty0] auto-execute command telnet 192.168.1.41
% This action will lead to configuration failure through ui-vty0. Are you sure?
[Y/N]:y