LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   redirecting physical console output (https://www.linuxquestions.org/questions/linux-newbie-8/redirecting-physical-console-output-721584/)

pwalter 04-25-2009 08:45 AM

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.

dxqcanada 04-25-2009 10:29 AM

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.

raskin 04-25-2009 10:34 AM

One program name: GNU screen. http://www.gnu.org/software/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.

kirany 05-13-2009 07:18 AM

Hi,

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.
kiran


All times are GMT -5. The time now is 12:46 AM.