How to run remote commands on Cisco Routers and Switches using RSH

If you are already a UNIX or LINUX administrator, you by now know what is rsh and how it can be used to run commands on a remote server. This is no different to running commands on a Cisco Routers and Switches.

You can run commands on your cisco routers and switches remotely from linux or unix servers and infact Windows XP, Windows 2003, Windows Vista systems.

The simple procedure listed here will help you to run commands remotely on rou cisco routers from your PCs.

Enable RCMD server for RSH & RCP

Cisco IOS by default disables the remote command execute feature through rsh and rcp.

ciscorouter# conf term

ciscorouter(config)# ip rcmd rsh-enable

Creata Local User

A local user account is required for the remote user to connect as and run commands remotely. This could be any user, however, recommended that the user is created with appropriate privileges for the purpose of security

ciscorouter(config)# username routeradmin privilege 7 password R0ut3radm1n

Create Remote User in Local Authentication Database

To allow the remote user to run commands on the cisco locally, the user needs to be added to the Local Authentication database.

ciscorouter(config)# ip rcmd remote-host routeradmin 192.168.1.100 netadmin enable

The above command allows a remote user named netadmin to run commands locally as user routeradmin from the remote host 192.168.1.100

Thats it done, now from the remote host 192.168.1.100, logged in as netadmin (local user on that remote system) run a remote command on the router.

c:\> rsh ciscorouter -l routeradmin sh run

This will run the command "sh run" logging in as "routeradmin" on the ciscorouter.

Some more useful RCMD options are

Remote Command Domain Lookup

ciscorouter(config)# ip rcmd domain-lookup

This will enable DNS lookup for rsh and rcp commands. This requires the global Domain lookup enabled.

RCP for remote user

ciscorouter(config)# ip rcmd rcp-enable

This will allow the remote user to rcp to and from the router. If you want to disable this feature then

ciscorouter(config)# no ip rcmd rcp-enable

Comments

One response to “How to run remote commands on Cisco Routers and Switches using RSH”

  1. Marc Avatar

    lol are you serious?

Leave a Reply

Your email address will not be published. Required fields are marked *