Click to See Complete Forum and Search --> : command aliases


eXtremist
11-08-2001, 11:05 AM
I just set up ssh so that I can connect to my 3 favorite servers w/o having to use a password. Now, I want to make it even easier for me.

I'd like to be able to type 'plato' and instantly be connected to the university server. Normally I'd have to type 'ssh user@plato.what.ever'. How can I set up an alias to do this and make it active every time I log on? (So I don't have to define the alias on every login).

X_console
11-08-2001, 11:08 AM
Edit your ~/.bashrc and put the following:


alias plato='ssh user@plato.what.ever'


Then do source ~/.bashrc Typing plato will automatically ssh you to plato. You'll still need to provide a password.

eXtremist
11-08-2001, 11:17 AM
excellent.. thanks a bunch..

I don't have to enter my password because I use RSA keys to authorize myself. Did this with ssh-keygen. Very slick.

later!

eXtremist
11-08-2001, 11:21 AM
One more thing.. I want to set up the aliases on all the servers, and two of them are running ksh. Do I have to edit a .kshrc file? (makes sense to do so)

I ask because there is no .kshrc file on the server already.

X_console
11-08-2001, 11:23 AM
You could put it in ~/.profile for ksh.

eXtremist
11-08-2001, 12:56 PM
Thanks! Actually, one of the shells was csh.. For that I had to use .cshrc