Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have a different (assigned, non-changable) username on one of the servers I log to regularly, and I would like to avoid writing it down every time. Can I make these lines

[tohecz@localhost ~]$ ssh
[tohecz@localhost ~]$ ssh

behave as the following?

[tohecz@localhost ~]$ ssh
[tohecz@localhost ~]$ ssh
share|improve this question
Can I ask why the question got downvoted? Have I done anything wrong? If so, please exaplain it to me so that I can improve the post. – yo' Apr 24 '14 at 12:22
I did not DV this but typically Q's that are very basic such as this or show little effort in searching prior to asking are viewed negatively. Also searching this site would've yielded many A's that show the below A: – slm Apr 24 '14 at 12:56
@tohecz Looking at man ssh_config and searching for User gives the result in about 30 sec. So, as slm says, it is very basic. I'm not suggesting asking such a question is a bad thing - one does have to know where to look, and that may not be obvious. I ask basic questions sometimes too, but some people may not like it. I'm also not justifying the downvote. I don't believe in them, except for spam. – Faheem Mitha Apr 24 '14 at 14:49
@FaheemMitha That sounds like I should know where to look. I consider any further discussion in this manner pointless. – yo' Apr 24 '14 at 15:03
@tohecz At the risk of redundancy, no disrespect or offense to you is intended. This was by way of response to you asking about the downvote. – Faheem Mitha Apr 24 '14 at 15:09

1 Answer 1

up vote 25 down vote accepted

Add the following in your ~/.ssh/config file:

  User tohecz

  User anotheruser

You can specify a lot of default parameters for your hosts using this file. Just have a look at man ssh_config for other possibilities.

share|improve this answer
Regarding other default parameters, I like shortening the host, along the lines of Host web / Hostname / User foo – Kevin Apr 24 '14 at 17:48
why only link to a web site for documentation that would be installed on almost every system with the openssh client installed? links die. local man pages are forever. at least mention that the info is available by running man ssh_config. – cas Nov 10 at 9:43

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.