LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-09-2004, 06:48 AM   #1
cpukiller
LQ Newbie
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware 10
Posts: 9

Rep: Reputation: 0
how to redirect the output of a terminal?


Hi there!

I have a linux box on which I'm gonna install a web server + ssh server. That computer is next to the one I have for common use - another linux box as well :P. What i would like to do is to put a screen dedicated to my server computer but no keyboard. I'll admin it by ssh from my other computer but seeing the result on the other screen.

It will allow me, for example, to start a network protocol analyser or a sniffer and let it running to see what's going on while i'm working on something else with my other computer.

The easy way is to add a keyboard to the server or... forget that idea and doing all remotely without screen and keyboard... but why do not put some challenge Ok... maybe it's very easy and i'm just not good enough...

I'm waiting for your suggestions!
 
Old 11-09-2004, 07:07 AM   #2
ralvez
Member
 
Registered: Oct 2003
Location: Canada
Distribution: ArchLinux && Slackware 10.1
Posts: 298

Rep: Reputation: 30
I think that what you want can be done if ...
1. You run ssh in the machine with no keyboard / monitor
2. You use ssh (client) in the second machine to access the first
3. You issuse the following connamd when logging into the keybordless computer (assuming the name of that machine is "nokeyboard"):
<command>
ssh -X your_login@nokeyboard
</command>

Now when you login into the machine you want to remote administer you can run GUI applications.

Hope this helps.

R
 
Old 11-09-2004, 07:29 AM   #3
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
I don't think that's what he wants. That would allow you to run gui applications on the machine without keyboard, with the gui being shown on your normal machine. He seems to want the output on the machine without keyboard.

The way I see it, there are two choices. If you need text-based output only, I'd try something like
Code:
top > /dev/ttySomething
to get the output redirected to a console

If you want to use gui's, I suggest you investigate VNC

Groetjes,

Kees-Jan
 
Old 11-09-2004, 07:25 PM   #4
cpukiller
LQ Newbie
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware 10
Posts: 9

Original Poster
Rep: Reputation: 0
thx kees-jan!

it works and it's simple. but i have a another question... At first, i thought i had to redirect to /dev/stdout. now i know that /dev/tty_something correspond to the virtual consoles but what about /dev/stdout. i don't understand how /dev/stdout works. On my computer, it's a symbolic link to /proc/self/fd/1. What's that exactly?
 
Old 11-10-2004, 03:11 AM   #5
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
/proc/123 for example represents the process number 123.
/proc/self represents the process that is currently accessing /proc.
Each /proc/xxx/ is a directory with various documented files (cmd is the command that started this process, exe is the actual binary...), and among those is fd: a sub-directory pointing at all file descriptors opened by the process.
Given the fact that 0 is always standard input, 1 standard output, and 2 standard error, you see that /dev/stdout is a link to a link to the the standard output of the process currently accessing /dev/stdout.

Logical.

Yves.
 
Old 11-10-2004, 07:07 AM   #6
cpukiller
LQ Newbie
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware 10
Posts: 9

Original Poster
Rep: Reputation: 0
nice!

yep it's logical
 
  


Reply


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
Redirect terminal output to file AND terminal shan Linux - General 3 09-29-2006 08:36 AM
Redirect sound output to modem omega71122 Linux - Software 3 06-24-2005 03:45 PM
redirect untar output mnauta Linux - General 3 05-01-2004 07:21 PM
output from cpio won't redirect to file rawii Programming 5 01-27-2004 01:49 PM
Ambiguous output redirect XFox Linux - Newbie 5 10-17-2003 07:29 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration