I created a shitty Python script to manage multiple SSH connections because I couldnt find a decent one (git.ohaa.xyz)
from Oha@lemmy.ohaa.xyz to python@programming.dev on 13 Nov 2023 17:02
https://lemmy.ohaa.xyz/post/888729

#python

threaded - newest

[deleted] on 13 Nov 2023 17:26 collapse
.
Oha@lemmy.ohaa.xyz on 13 Nov 2023 17:41 collapse

Then any time you run ssh myserver.net, it’ll use the user you specify here by default.

Wouldnt really help in my use case bc I use the same user on every server

Fal@yiffit.net on 13 Nov 2023 18:04 next collapse

It was just an example. What does your script do that wouldn’t be configurable in ssh config

Oha@lemmy.ohaa.xyz on 13 Nov 2023 18:18 collapse

not much, probably. Ill add some features in the future tho

[deleted] on 13 Nov 2023 18:25 next collapse
.
__init__@programming.dev on 14 Nov 2023 03:19 collapse

The “host” is just your friendly name for the connection, not necessarily the hostname of the remote host. You can specify the same username or hostname as many times as you want. My config is made up of mostly blocks like this:

Host server1
    HostName server1.you.com
    User your_ssh_username
    IdentityFile ~/.ssh/yourprivatekey.pem
  
Host server2
    HostName server2.you.com
    User your_ssh_username
    IdentityFile ~/.ssh/yourprivatekey.pem