So I googled and found out that you can create aliases in
.bashrc to ensure you have a quick access to your ssh servers like so :
alias connectme='ssh email@example.com -p 999'
that's quite nice I only have to type
connectme and the password. I googled some more and it turns out you can do this
alias connectme='sshpass -p "thepasswordincleartext" ssh firstname.lastname@example.org -p 999'
(yes the second
-p is correctly passed as "port" not "password" to the second command; ssh )
I googled some more ans started creating a
that's when I hit a road bump :
- either the passwordless version of that alias works but I have to type password everytime.
- or I add
sshpassand the terminal window closes upon completion of the connection.
(I tried forcing terminal to stay open upon command completion in it's options, that's when I realised .desktop runners actually type out "exit" and force the disconnect)
here's what I'm working with :
#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=true Exec=bash -c 'exec bash -i <<<"connectme"' Name=connectme Comment=connectme Icon=/home/user/.local/share/icons/debian.png
this elaborate stupidity :
bash -c 'exec bash -i <<<"command"'
is done because for some reason Exec doesn't encompass the bash and your userspace realm. I haven't got a clue why not.
How do I set up a working launcher for ssh with bundled password (and why not a first command piped to the remote server upon connection)?
I'm willing to edit environement if that's what it takes.