1

I would like to connect to each server using the root user and to machin server using me user.

I edit .ssh/config

 User root
 Host machin
 Hostname machin
 User me

When I type

 ssh machin

I get

 root@machin's password:

What is wrong with my config?

4

According to the ssh_config manual page:

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.

You should change the order of your configuration values, first set the host-specific ones then the general ones:

Host machin
Hostname machin
User me
User root

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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