Xfce Forum

Sub domains
 

You are not logged in.

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

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

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: 4

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: 9,211

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.

Offline

Board footer

Powered by FluxBB