cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1032
Views
4
Helpful
3
Replies

using an alias for ssh

joshuahurley
Level 1
Level 1

I am currently trying to use an alias so i can type hostname in to ssh instead of remembering IP address. Does anyone know how to input this in a switch 9300. I have tried alias exec ssh (ip address) (hostname) and it does not work any help would be really appreciated. 

3 Replies 3

marce1000
VIP
VIP

 

          - Make sure that the hostname can be resolved by DNS on the switch , 

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

Hi

 If you have "ip domain name"  and "ip domain lookup" on the device you should be able to access using ssh -l "user" device.domain

I would say alias is more suitable to hide a command or a group of command in one word. 

mmohammed
Level 1
Level 1

 

To configure an alias for SSH access on a Cisco Catalyst 9300 switch, you need to use the ip host command. Here's the correct syntax:

ip host <hostname> <ip-address>

Replace <hostname> with the desired alias or hostname and <ip-address> with the corresponding IP address. Here's an example:

Switch(config)# ip host myswitch 192.168.1.100
This configuration will create an alias called "myswitch" for the IP address 192.168.1.100. Once configured, you can use the alias instead of the IP address when connecting via SSH.

To establish an SSH connection using the configured alias, you can simply type:

ssh <hostname>

In this example, it would be:

ssh myswitch

Make sure you save the configuration using the write  command to ensure the alias persists after a reboot.

If you're still encountering issues, please provide more details or error messages for further assistance.

Review Cisco Networking for a $25 gift card