Examples
The following
example illustrates the initiation of a secure session between the local device
and the remote host HQhost to run the
show
users command. The result of the
show
users command is a list of valid users who are
logged in to HQhost. The remote host will prompt for the adminHQ password to
authenticate the user adminHQ. If the authentication step is successful, the
remote host will return the result of the
show
users command to the local device and will then
close the session.
Device# ssh -l adminHQ HQhost "show users"
The following
example illustrates the initiation of a secure session between the local device
and the edge device HQedge to run the
show
ip
route command. In this example, the edge device
prompts for the adminHQ password to authenticate the user. If the
authentication step is successful, the edge device will return the result of
the
show
ip
route command to the local device.
Device#ssh -l adminHQ HQedge "show ip route"
The following
example shows the SSH client using 3DES to initiate a secure remote command
connection with the HQedge device. The SSH server running on HQedge
authenticates the session for the admin7 user on the HQedge device using
standard authentication methods. The HQedge device must have SSH enabled for
authentication to work.
Device# ssh -l admin7 -c 3des -o numberofpasswordprompts 5 HQedge
The following
example shows a secure session between the local device and a remote IPv6
device with the address 2001:DB8:0000:FFFF:FFFF:FFFF:FFFF:FFFF to run the
show
running-config command. In this example, the
remote IPv6 device prompts for the adminHQ password to authenticate the user.
If the authentication step is successful, the remote IPv6 device will return
the result of the
show
running-config command to the local device and
will then close the session.
Device# ssh -l adminHQ 2001:DB8:0000:FFFF:FFFF:FFFF:FFFF:FFFF "show running-config"
The following
example shows an SSH Version 2 session using the crypto algorithm aes256-ctr
and an HMAC of hmac-sha1-96. The user ID is user2 and the IP address is
10.76.82.24.
Device# ssh -v 2 -c aes256-ctr -m hmac-sha1-96 -1 user2 10.76.82.24
The following
example shows how to configure reverse SSH on the SSH client:
Device# ssh -l lab:1 device.example.com
The following
command shows how to connect reverse SSH to the first free line in the rotary
group:
Device# ssh -l lab:rotary1 device.example.com