TransWikia.com

Make Windows ssh not use my Windows account by default?

Super User Asked on November 4, 2021

Seems like unless I specify -l <account name on the remote computer> when typing ssh <ip>, the ssh command just uses my Windows account name by default. This is annoying. Can I make it not use my Windows account name and ask for the user name by default, when -l is not used?

One Answer

OpenSSH always uses the current user's name unless you either specify one by writing it before an at sign (e.g., ssh [email protected]) or you use the -l option. However, you can adjust this using ~/.ssh/config if you like by specifying something else:

Host github.com
    User git
Host *
    User bk2204

This will use the user git for github.com and bk2204 for all other sites. You can still override it at the command line with the two techniques I mentioned above.

Answered by bk2204 on November 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP