Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to log in on a remote pc, example, from my local machine, called umar. the user on the remote machine is 'coolapp', so i want to pretty much do: ssh coolapp@ and not enter a password but log in with public key. the problem is that on my local machine, i dont have a user 'coolapp'. how can i log in on the remote machine without having to first create a user 'coolapp' on my local machine and generating the ssh keys for it?

share|improve this question
People are going to be wary of offering you answers as long as you have a low accept rate. That's because this community thrives on having good answers to good questions. If someone has given you a good answer in the past, but you did not mark it as such, the community is weakened. Now, if you truly did not get good answers to your previous questions, then edit your previous questions and say that you're still looking for a satisfactory answer. –  Bart De Vos Nov 22 '11 at 14:02
@BartDeVos i try to mark the correct answers as accepted, and have more than 50% accepted answers on stackoverflow, but on serverfault, the problem is that i post a question, sometimes the answers dont work out so i cannot mark any as acccepted, then i later either solve the problem myself, or do a workaround, or it is still unsolved but does not bug me anymore. if i do a workaround, then my pc configuration changes, and even if someone answers it later, i cannot use the answer and hence cannot accept any as i wont know if it works or not. in programming, it is easy to return toananswerlater.. –  umar Nov 23 '11 at 12:40
@BartDeVos and mark as accepted, or post ur own answer, but here, if my pc configuration changes, or i solve it myself and forget the solution later on, i cannot come back to mark answers as accepted. after ur comment i checked my profile, and there was a question about sshing between two laptops. now i dont have that same problem as i dont have another laptop, so i dont know how to check answers and mark as accepted the right answer. may be later when i know more, i can revisit the answers and mark some as accepted, thanks for pointing it out to me. –  umar Nov 23 '11 at 12:42
add comment

2 Answers

up vote 3 down vote accepted

try on your local machine

ssh-copy-id coolapp@

if you didnt create your key then before ssh-copy-id you must execute



ssh coolapp@

share|improve this answer
ur answer answers the problem completely without explaining how it solves the problem. the one on top explains without answering it completely. so i am still thinking which answer to mark as accepted ... –  umar Nov 22 '11 at 13:58
add comment

You are mixing a few things up here. You do not need to have the same user name across systems to be able to log in on remote systems.

Make sure to put your key on the remote server (public part), and on your local machine (private part) (and check the rights). Then you should be able to login with:

ssh coolapp@    

without being asked for a password (unless you have a key that needs to be unlocked).

Your private key should be in ~/.ssh/id_rsa. Make sure the right are set properly:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa 

Your public should be at ~/.ssh/authorized_keys and have the following rights applied:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Finally, go and check in /etc/ssh/sshd_config if keys are allowed to be used.

share|improve this answer
i know that, when i enter ssh coolapp@, it asks for a password, which i enter and i am logged in. however, i want to log in without needing a password. i am logged in as another user, 'umar' on my local machine, so that there is no coolapp user on my local machine –  umar Nov 22 '11 at 13:17
If he still asks you for a password, you probably have made an error. Check the rights and location of the keys and check if your ssh-config allows for keys to be used. I've updated my answer. –  Bart De Vos Nov 22 '11 at 13:26
thanks for the detailed answer, i actuall learnt from serverfault.com/questions/114388/… that i dont need to have the same user on my local machine, i just need to 'tell' the remote machine that my machine is authorized to access the remote machine as user 'a' by copying local machine's public key to remoteuser@remotemachine's .ssh/authorized_keys file –  umar Nov 22 '11 at 13:49
add comment

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.