CCNA Part 10: CLI and SSH

Part 10 – SSH and CLI tips

Listing commands

When we wish to configure a router or switch, we obviously use commands but we may not know every command.

Connect to your router first in user mode

1.       At the command prompt hold down shift + ?

2.       You should now see a list of commands available in use mode

Router>?

Exec commands:

 <1-99>                Session number to resume
connect               Open a terminal connection
disable                Turn off privileged commands
disconnect          Disconnect an existing network connection
enable                 Turn on privileged commands
exit                       Exit from the EXEC
logout                 Exit from the EXEC
ping                      Send echo messages
resume                Resume an active network connection
show                    Show running system information
ssh                        Open a secure shell client connection
telnet                   Open a telnet connection
terminal              Set terminal line parameters
traceroute          Trace route to destination

3.       Now type enable command for priviaged mode and now shift +?

Now  you can see a lot more commands available to privilege mode

<1-99>      Session number to resume

Auto                     Exec level Automation
clear                     Reset functions
clock                     Manage the system clock
configure            Enter configuration mode
connect               Open a terminal connection
copy                     Copy from one file to another
debug                  Debugging functions (see also ‘undebug’)
delete                  Delete a file
dir                         List files on a filesystem
disable                Turn off privileged commands
disconnect          Disconnect an existing network connection
enable                 Turn on privileged commands
erase                    Erase a filesystem
exit                       Exit from the EXEC
logout                 Exit from the EXEC
mkdir                   Create new directory
more                    Display the contents of a file
no                         Disable debugging informations
ping                      Send echo messages
reload                  Halt and perform a cold restart
reload                  Halt and perform a cold restart
resume                Resume an active network connection
rmdir                   Remove existing directory
send                     Send a message to other tty lines
setup                   Run the SETUP command facility
show                    Show running system information
ssh                        Open a secure shell client connection
telnet                   Open a telnet connection
terminal              Set terminal line parameters
traceroute          Trace route to destination
undebug             Disable debugging functions (see also ‘debug’)
vlan                      Configure VLAN parameters
write                    Write running configuration to memory, network, or terminal

To list a command quicker if you know the first letter or part of the command name you simply need to type the following

1.       Type in the command prompt c?

Now the terminal will show you all possible commands begging with “C”

Router#c?

clear clock  configure  connect  copy 

Now if we want to be a little more specific we just need to specify more letters. For example if we know the first 3 letters of a command we can do the following:

1.       Type in the command prompt con? Now you will be listed commands that begin with con

Router#con?

configure connect

When you are in configuration mode and wish to run a command that only works with privileged mode you can issue the do command, for example if you are in configuration mod but wish to run the show running-config which only works in privileged mode, simply use the do command.

Type do show running-config or short do show run

 

 

Enabling SSH and disabling Telnet.

1.       Logon to your router > enable (privileged mode)

2.       Go to config mode config t

3.       Give your router a name if not already configured ip domain name robertwelsh.local

4.       Type User

5.       Type username robert  password cisco

6.       Type Crypto

7.       Type Crypto key

8.       Type Crypto key genet

9.       Type crypto key generate rsa general-keys modulus 1024

10.   Type crypto key generate rsa ? to see crypto commands

11.   Last enable SSH v2, use the following command ip ssh version 2

12.   Now  we need to disable telnet line line vty 0 4

13.   Type transport input ssh, now telnet is shutdown and ssh is enabled

14.   Exit exit

15.   Now we need to save the configuration, copy running config startup-config

Now test

Open your Putty client and first test login with telnet, should not work

 

Now try with SSH, you should be able to login, you will be presented with a certificate

When you login you will be asked for user and pass, its going to fail, this is because we need to set the local login.

1.       Get to configuration mode config t and then type login local

2.       Exit exit

3.       Show running configuration

 

4.       Finish.

Scroll to Top