LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-19-2014, 01:54 AM   #1
heronlin
LQ Newbie
 
Registered: Jun 2012
Posts: 14

Rep: Reputation: Disabled
open Konsole after boot and login, run a command, keep Konsole open for use


I want to ssh automatically to remote server by opening Konsole after login, runnning ssh command and using the shell from then on.

Google for solutions leads to lots of advice on running a command in a shell at boot and keeping it open with, for example, 'konsole --noclose -e <command>'. This does not help because the konsole has no command prompt.

I want to to do this without using screen, which I don't get along with. I get lost in a maze and bad things happen when I type something thinking I'm local when I'm remote or vice versa. I've tried to use screen for days and have had to restore from backup several times because of errors made.

I would like to do this because I have three servers in three shells and when I restart the saved session comes up with three shells containing three broken pipes.

I use KDE/Arch and Kubuntu on different machines. I would like to be able to do this on either machine.
 
Old 10-19-2014, 07:21 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
My first approach to this problem would be with screen. Why, exactly, does it make you confused? I don't understand the difficulty, but maybe I'm missing something. Your explanation of some maze and local vs remote confusion makes no sense to me.

Last edited by suicidaleggroll; 10-19-2014 at 07:22 PM.
 
Old 10-19-2014, 10:02 PM   #3
heronlin
LQ Newbie
 
Registered: Jun 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
It's just me, I can't remember if I've got a screen that I can't see at the moment, which terminal window opened on which desktop or which shell I'm in when I resume after a few hours.

The only time I would use screen is for a large inter-server file transfer to ease resumption after a loss of connectivity.

I access three remote servers in up to six different shells, alongside shells for different tasks on three local machines, with 14 desktops between them. Everything has worked smoothly for years but adding screen to the mix makes it too confusing for me.

It would be convenient if those shells could ssh to their server and be fully ready for use after a session restore. At the moment, all I have to do is type a command in each shell. Using screen would make my day more difficult not easier. If konsole can open a new shell, execute a command and stay open, it can't be that difficult to have that shell that stays open be usable for more commands rather than just visible?
 
Old 10-20-2014, 03:01 AM   #4
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
If I understand you correctly you want to open a number of shells that connects to one server each?
I do this with gnome-terminal, this command opens 3 tabs in a terminal and connects to 3 different servers:
Code:
gnome-terminal --tab -e "sudo c0" --tab -e "sudo c1" --tab -e "ssh myserver.se -p 222"
(The commands "c0" "c1" are bash scripts that contains the ssh connection string.)
Using ssh keys I don't even need to type in password, I have 3 shells ready on one server each with that single command.
 
1 members found this post helpful.
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I open Konsole without mouse? dtee Linux - Newbie 3 04-19-2011 05:06 PM
open konsole from within konqueror? fantasmagoric_fred Linux - Newbie 3 03-17-2007 09:57 AM
open konsole from keyboard K. Carl Linux - Newbie 1 07-09-2005 04:58 PM
How to automatically run a command when you open a Konsole shazam75 Linux - Software 3 11-30-2004 04:02 AM
Open several terminals in konsole jorgelon Linux - Software 9 11-01-2004 03:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:39 PM.

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