LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-07-2018, 06:20 PM   #1
jorgeluis
LQ Newbie
 
Registered: Nov 2007
Posts: 22

Rep: Reputation: 1
Question How to make terminals to automatically ssh to another server?


Hi! How can I configure my desktop (gnome 3.14.2 on RHEL server 3.7, non-root user) or tweak my .cshrc so that whenever I open a terminal (Applications->Terminal) it automatically SSHs to another server?
Context: my institution's setup makes you always login on a "display server", but all the actual work we do in "computation servers". Thus, every time I need to launch a process I need to open a terminal and manually ssh to one of the work servers, which becomes cumbersome.
(Note the system is setup in such a way that is impossible to login directly to the work servers, so the login and the desktop are always launched in the "display server")

I tried adding the ssh command to my .cshrc, but (of course!) it didn't work as it entered an infinite loop of "recursive" SSHing!

Thanks in advance for any help!
 
Old 08-07-2018, 06:28 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
try creating a .desktop file set the exec command to yoir ssh commanx and set the runinterminal option to true then just launch th .desktop file
 
Old 08-07-2018, 06:37 PM   #3
jorgeluis
LQ Newbie
 
Registered: Nov 2007
Posts: 22

Original Poster
Rep: Reputation: 1
Thanks for your reply, Keith. Could you please elaborate a little? I have no experience with .desktop files...
 
Old 08-07-2018, 06:58 PM   #4
jorgeluis
LQ Newbie
 
Registered: Nov 2007
Posts: 22

Original Poster
Rep: Reputation: 1
OK, I've created the file ~/.local/share/applications/ssh_to_workserver01.desktop with the following contents:

Code:
[Desktop Entry] 
Encoding=UTF-8 
Verslon=l.0 
Name[en_US]=workserver01 
GenericName=SSH to workserver01 
Exec=ssh workserver01 
Terminal=true
Icon[en_US]=/usr/share/icons/gnome/32x32/apps/utilities-terminal.png 
Type=Application 
Categories=Application; 
Comment=workserver01
and I made it executable. How do I make my desktop "load" it? I see it nowhere in my Applications menu...
 
Old 08-07-2018, 07:53 PM   #5
jorgeluis
LQ Newbie
 
Registered: Nov 2007
Posts: 22

Original Poster
Rep: Reputation: 1
OK, after some tweaking I manages to get the launcher to appear under "Applications->System Tools"! However, it opens a terminal but DOESN'T SSH to the intended server... what I am missing? Here are the contents of my launcher:

Code:
[Desktop Entry] 
Name=workserver01 
Comment=workserver01
TryExec=ssh workserver01 
Exec=ssh workserver01 
Icon=utilities-terminal
Type=Application 
Categories=GNOME;GTK;Utility;TerminalEmulator;System;
StartupNotify=true
X-Desktop-File-Install-Version=0.15
 
Old 08-07-2018, 08:11 PM   #6
jorgeluis
LQ Newbie
 
Registered: Nov 2007
Posts: 22

Original Poster
Rep: Reputation: 1
OK, got it to work! This is the entry that worked:

Code:
[Desktop Entry] 
Name=workserver01 
Comment=workserver01
Exec=ssh workserver01 
Icon=utilities-terminal
Type=Application
Terminal=true 
Categories=GNOME;GTK;Utility;TerminalEmulator;System;
StartupNotify=true
X-Desktop-File-Install-Version=0.15
...How can I "integrate it" so that it will appear when I right-click the mouse over the desktop?
 
Old 08-07-2018, 08:54 PM   #7
jorgeluis
LQ Newbie
 
Registered: Nov 2007
Posts: 22

Original Poster
Rep: Reputation: 1
...or, at least, how can I make the launcher appear under "Applications->Favorites" (the 1st entry when clicking the "Applications" button)?
 
Old 08-08-2018, 12:09 AM   #8
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 510

Rep: Reputation: 58
i have problems following your reasoning for having remote desktop but not wishing to use it

you can make an icon and set the icon properties to start xterm (or konsole, or whut). the options for start up will allow you to type in a bash script line to start xterm
 
Old 08-08-2018, 12:12 AM   #9
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 510

Rep: Reputation: 58
you can run "ssh" to run commands on the remote computer and who's output dump back into your local terminal: you don't need to open a terminal

if your thinking about running "main framing commands" ssh is too slow. you want RPC remote procedure protocol. it's like ssh without all the garbage attached to it. (rather, ssh is a VERY bloated shell to rpc that prevents mainframe computing)

now that being said: you can make file sockets (in real unix, if your running unix, everything is a file). this means the file can be a tcp socket on both sides appearing to be a file. scripts can read and write though it (commands or data) quickly

but that's about sockets and rpc and you probably not mainframing anyhow

"computation servers" means mainframing. you probably have access to download free software that can run "parallel computing processes" and should do that. for example, in Mathematica one can run a program multiple cpu threads or multiple remote computers. which is probably rarely done by most users. it's all set up and ready to go. you can get it free if you buy a rasperi pi i think: which runs linux or freebsd currently.

linux has look-alike work-alike software and some of it i feel strongly will do computations in a higher level language and easily allow multiple sessions (ie on other computers) to combine as "computation servers" with absolutely no effort but specifying that is what is to be done on a particular calculation.

Last edited by X-LFS-2010; 08-08-2018 at 12:21 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to make ssh without password from mulitple server to single server by deepak_message Linux - Server 5 08-26-2012 12:03 PM
How to Lock idle terminals automatically LINUXQueAns Linux - Server 1 11-10-2010 04:08 AM
How do I automatically make a ssh key? cereal83 Linux - Security 11 09-20-2005 02:16 PM
Terminals - spying on local terminals with ssh BeatRyder Linux - Software 5 10-21-2004 01:47 AM
Over 100 terminals open automatically after login kimbergross Linux - Newbie 1 10-01-2003 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration