Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-25-2009, 08:45 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
redirecting physical console output

This isn't a question on how to use a client like PuTTY to access a terminal session over SSH. What I am looking for is a software solution which, once the boot process is complete, "forks" the primary console input and output to a remote terminal program over a defined port, while allowing the primary console to be active simultaneously - similar to a remote control program for That Other Operating System (I notice the forum rules prohibit the mention of the name here :-)) Why do I need it? Well, if you use PuTTY to connect to a console session, and start a program running, if the ssh connection fails, the console session dies and kills the program. Also, no one at the physical console can see what you are doing. I need to find a way to keep a persistent session mirroring the physical console, and re-connect to it if the connection fails. There is a lot of stuff on the internet on (perhaps) how to do it over a COM port connected to KVM hardware, but almost nothing about how to do it over a port. Is this even possible? I use a Centos-based distribution. Any pointers would be gratefully appreciated.
Old 04-25-2009, 10:29 AM   #2
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
The usage of the serial interface as console is still the best route to take.
A single port terminal server that supports SSH will do.
The remote SSH session will be between your remote client and the terminal server, so if the session is dropped it will not affect the Linux serial console session. Also you get the added benefit of the boot messages, and not having to rely on other process's to obtain remote access.
[my company sells these ... so I am a little biased]

If you connect directly to the Linux host via an SSH client, you can use a utility such as "screen" to create a shell that you can detach from to have an app running if you disconnect.
Old 04-25-2009, 10:34 AM   #3
Senior Member
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (
Posts: 1,900

Rep: Reputation: 68
One program name: GNU screen. . yum -v install screen . Useful switches: -U (Unicode support, if you use UTF-8 locale), -R (reattach), -x (reattach without kicking previous user - share a session). Useful key combination: "Ctrl-a d" - disconnect that instance of screen from the (possibly shared) session.
Old 05-13-2009, 07:18 AM   #4
Registered: Feb 2007
Posts: 30

Rep: Reputation: 15

I am working on a embedded linux project and facing an issue in identifying the ssh port number from a ssh client.
The entire approach is in this way, The SSH Client Module is started up by the Operating System’s SSH daemon when a ssh user login remotely and It’s standard input and output is redirected through the SSH encryption module.

So using some system calls supported by linux OS I need to convert this standard input and output to a valid descriptor and get the ssh port number on which the user has connected.

can anyone help me how I can get the port number?

thanks in advance.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Redirecting output from screen to console from boot-up ? exceed1 Linux - General 3 11-23-2008 10:26 PM
redirecting output into new script vortmax Linux - General 1 04-25-2008 03:16 PM
A little help with redirecting output tybalt Linux - Newbie 1 08-04-2007 10:08 PM
redirecting output using > cmk77 Slackware 8 11-10-2006 02:08 AM
Redirecting Console MadnessASAP Linux - Software 3 10-19-2005 12:42 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:27 AM.

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