Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-09-13 17:32:24

CaptNemo
Member
Registered: 2022-09-13
Posts: 5

SSH session launcher?

Can someone tell me how to create an SSH session launcher?

I would like to create a desktop launcher that will open a terminal and run "ssh -p22 user@url.com"

I've tried using xfce4-terminal with the "-H"  and "-x" options but, they fail.

Offline

#2 2022-09-13 19:34:35

Jordi
Member
Registered: 2022-09-12
Posts: 6

Re: SSH session launcher?

Graphically, right click the desktop, select "Create Launcher". Then fill in your command "ssh -p22 user@url.com", give it a name, and select “Run in terminal”.

Or, you can create a text file ~/Desktop/my_launcher.desktop with the content:

[Desktop Entry]
Version=1.0
Type=Application
Name=MyLauncher
Exec=ssh -p22 user@url.com
Terminal=true

Offline

#3 2022-09-13 19:45:00

CaptNemo
Member
Registered: 2022-09-13
Posts: 5

Re: SSH session launcher?

So, lets add a twist....  Let's say I want to knock first-

ssh -p8888 url.com;ssh -p22 user@url.com

This fails...

Offline

#4 2022-09-13 19:56:22

Jordi
Member
Registered: 2022-09-12
Posts: 6

Re: SSH session launcher?

From .desktop files you can only execute one command. But you can execute bash with a script or with a string of commands with the -c option:

[Desktop Entry]
Version=1.0
Type=Application
Name=Test
Exec=bash -c "ssh -p8888 url.com; sleep 10; ssh -p22 user@url.com"
Terminal=true

Tune the sleep time as needed.

Offline

#5 2022-09-15 00:58:47

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: SSH session launcher?

Try this on the Exec line instead:

bash -c "ssh -p8888 url.com; sleep 10; ssh -p22 user@url.com; bash"

Might at least show any errors if they exist.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 529.03 KiB (Peak: 530.31 KiB) ]