Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I often use this command to connect to another server with x forwarding:

[myuser@server1]$: ssh -Y ( is server2)

myuser@'s password:


I need an alias which will ssh to server2 with -Y option, and also enter my password for me.

How do I do it?

Best Regards

share|improve this question
Carry out ssh-keygen -t rsa accept defaults. Copy that file to using ssh-copy-id -i ~/.ssh/ myuser@ you can use ssh -Y 'myuser@'. Use this if you need more help. (Although its from Debian, it applies to all Linux flavours). Hope this helps. – user112665 Mar 28 '12 at 16:56
Also, while aliases are good with only a few servers, ssh config file is a bit better for a larger environment, and a few other neat tricks in the comments on this page:… – Rob Mar 28 '12 at 17:08

You must log in to answer this question.

Browse other questions tagged .