User Tools

Site Tools


Default SSH user

A better solution than putting an alias in your bashrc, would be to use a ssh config file

cat ~/.ssh/config
HOST *  
USER root

You can also specify certain subdomains use certain users. Useful if your laptop travels between networks.

HOST 192.168.*.*
USER homeuser
HOST 10.2.*.*
USER workuser

You could even configure by domains, and use different ssh keys for different domains.

USER bill
IdentityFile ~/.ssh/microsoft/id_rsa
USER steve
IdentityFile ~/.ssh/apple/id_rsa

More resources to read:

sandbox/default-ssh-login-user.txt · Last modified: 2019/04/25 23:40 by dreiggy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki