all 8 comments

[–]Nietzsche_at_last 3 insightful - 1 fun3 insightful - 0 fun4 insightful - 1 fun -  (4 children)

if i understood the problem corectly, i think SSH config file is made for that. you can give entries to machines with users you want to use and what auth to use and so on: Host dev HostName dev.example.com Port 22000 User fooey

"ssh dev" is enough to type then. look it up there are many guides online.

[–]dissent[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

That is even better than I'd imagined. Thank you so much!

https://linuxize.com/post/using-the-ssh-config-file/

[–]dissent[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (2 children)

Turns out after it's setup you can just 'ssh TAB TAB' and get a list of connections. Don't even have to remember the names. Thank you again.

[–]Nietzsche_at_last 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

glad that you are happy about such a small thing : )

a nice link you provided.

[–]dissent[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

Not small for me. I'm forever ssh'ing in to misc machines. The repetition this saves is excellent

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

I'm just a student so shoot me if I'm ass-backwards on this, but can you save each ssh target address (me@ip) as a variable in your bash profile? Like A=me@ip1 B=me@ip2 and then use ssh $A ssh $B to connect? For a menu you could make a variable $sshmenu that contains all the ip variables in a list. echo $sshmenu returns A=me@ip1 etc...

[–]billfolddog 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

You can, but I highly recommend you use your ssh config file instead.

https://linuxize.com/post/using-the-ssh-config-file/

If you format it correctly, you can just type ssh myserver and the correct username, port number, and cryptographic keys will automatically be used.

Even better, many applications will refer to your config file. Nautilus can mount an SSH target as attached media, and it will use your SSH config file to streamline configuring the mount point. In many cases, this is the only way to make that work.

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)