I want to log in on a remote pc, example 10.10.10.5, from my local machine, called umar. the user on the remote machine is 'coolapp', so i want to pretty much do: ssh [email protected] 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?
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:
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:Your public should be at
~/.ssh/authorized_keys
and have the following rights applied:Finally, go and check in
/etc/ssh/sshd_config
if keys are allowed to be used.try on your local machine
ssh-copy-id [email protected]
if you didnt create your key then before
ssh-copy-id
you must executessh-keygen
then
ssh [email protected]