LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 02-25-2005, 08:47 PM   #1
chris318
Member
 
Registered: Feb 2005
Distribution: Slack
Posts: 122

Rep: Reputation: 18
Terminal Questions? "cat /dev/tty1" Why Not?


How come I can echo a tty device by doing "echo hello > /dev/tty1", but I can't cat a tty device? If I try to do a "cat /dev/tty1" in tty2 for example I don't see the output of tty1. I'm doing this as root by the way. I can see how this may be a security thing but root should be able to do anything?

Lets say I log into X from tty1 using startx. I then go into an X session. Now I go to tty2 and type startx -- :1 and start anothr X session. alt F7 and alt F8 are my X session. What is the equivalent tty devices created on F7 and F8?

Now while I'm in X I start up xterm. The device now is /dev/pts/1. What type of terminal is this and what relation does it have to the reguler tty's?

While I'm in xterm I would like to see the logging output of X and the window manager going to tty1. How come "cat /dev/tty1" doesn't give the desired results? How can I redirct all output going to tty1 to /dev/pts/1?

I know I can "startx > xlog 2>&1" and then go to any terminal and do a "tail xlog" but this is not what i'm looking for. This is not really what I'm looking for.

Doesn't all input and output of a terminal go throught the tty device? So shouldn't cat tty just show you everything going in and out?
 
Old 02-25-2005, 09:57 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 117Reputation: 117
With your question about X, X sessions have no associated PTY. They are not terminal devices. You can't "cat" a tty because it's already being read by the terminal manager.
 
  


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
lilo says, "L 01 01 01" and fdisk says, "Unable to seek on /dev/hda1" clausawits Linux - General 3 12-31-2007 09:33 PM
Terminal Questions? "cat /dev/tty1" Why Not? chris318 Linux - Newbie 3 02-24-2005 10:59 PM
V4L: "cat /dev/video0: no such device"; to be sure not supported? jago25_98 Linux - Hardware 1 01-27-2005 04:04 PM
What is adsp0? and why cat /dev/urandom >/dev/adsp0 give me "no such device"? haimeltjnfg Linux - Hardware 2 05-09-2004 10:54 PM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-21-2003 11:47 PM


All times are GMT -5. The time now is 07:15 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