Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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

[email protected]'s password:

[$myuser@server2]:$

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
2  
Carry out ssh-keygen -t rsa accept defaults. Copy that file to using ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]then you can use ssh -Y '[email protected]'. 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: howtogeek.com/75007/… –  Rob Mar 28 '12 at 17:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.