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 root@192.168.1.12 -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 root@192.168.1.12 -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 .desktop launcher.
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.
ssh yourserverthat might be useful https://askubuntu.com/questions/1027428/sshd-login-get-permission-denied-publickey-what-am-i-doing-wrong/1027452#1027452 – Katu Mar 01 '19 at 08:18