You are not logged in.

#1 2008-02-15 06:38:05

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

ttys are not owned by group tty (and /dev/pts verses /dev/vc)

I just tried to do a "mesg y" in my terminal on my dekstop and got the error:

mesg: error: tty device is not owned by group `tty'.

So I chowned my tty to belong to group tty (previously it was owned by my generic group "users", of which b-con is a member) and it worked fine. I then checked my active ssh connection from my laptop and its tty *was* owned by group tty.

I assume there is something that is setting my created ttys to belong to the current user group by default instead of tty? Where might that be? I scanned all relevant bash profile/rc's and found nothing.

On a related note:

Right now I'm logged into my machine as normal, ie, into X and have a terminal running. I'm also logged in, as another user, via ssh. When I execute the "who" command, I see:

b-con    vc/7         Feb 14 12:34   .          6894 (:0)
rj       pts/2        Feb 14 22:02 00:03        9849 (192.168.0.4)

Why is b-con, the user logged in from the physical keyboard, shown as logged on vc/7 while the ssh user (rj) is shown as being on pts/2? User b-con has terminals on pts/0 and pts/1 open, so why is he reported as being on vc/7?

I was trying to use the "write" command to communicate between the two users, and b-con can write fine to rj on pts/2, but rj cannot write back to b-con because "/dev/vc/7: Permission denied". If I specify "write b-con /dev/pts/1" then I get the error "b-con is not logged in on pts/1". This is true because it's not my login shell, but it still is a shell I'm on.

Any enlightenment? I assume the latter half of my question boils down to login shells...

Offline

#2 2008-02-16 11:05:33

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: ttys are not owned by group tty (and /dev/pts verses /dev/vc)

vc/7 is the KDM/GDM login, which is obviously owned by root and not meant to be used for 'write'. You should start a login shell in Xorg to get another pts.


1000

Offline

#3 2008-02-18 08:15:30

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: ttys are not owned by group tty (and /dev/pts verses /dev/vc)

Hm, so write can only work with login shells, it seems. Ah well, that destroys a bit of its potential convenience.

So, why are all my tty's owned by the "users" group? Is that standard / does it have an advantage over having them owned by group tty by default?

Offline

#4 2008-02-26 20:59:53

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ttys are not owned by group tty (and /dev/pts verses /dev/vc)

byte wrote:

You should start a login shell in Xorg to get another pts.

Nice, but how do you start another login shell inside X? I have no clue...

Thanks smile


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#5 2008-02-26 22:40:25

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: ttys are not owned by group tty (and /dev/pts verses /dev/vc)

I would assume:
$ bash -l

because from the bash man page:

-l        Make bash act as if it had been invoked as a login shell (see
                 INVOCATION below).

but if I do so I get

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Last edited by B-Con (2008-02-26 22:42:49)

Offline

#6 2008-02-27 16:54:39

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ttys are not owned by group tty (and /dev/pts verses /dev/vc)

I don't get that error, but I get the usual "write: user has messages disabled". I guess it's because even though it's a login shell, it's a subshell of the virtual console, being a child process...
It's really useless to me to be able to use write only in the tty.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#7 2008-02-27 20:29:15

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: ttys are not owned by group tty (and /dev/pts verses /dev/vc)

Yeah, it is pretty worthless. Designed for the pre-X11 days, I suppose.

Since the tty's are owned by user group of the owner, if the users you wish to communicate are of the same gropu you can use the primitive
$ echo text > /dev/pts/X
if you just want to move a little it of information around. You probably wouldn't want to hold a conversation that way, though. ;-)

Another way around it would be for both users to share a screen session (Google for tutorial). If you just open up nano you can hold a decent IM convo. For two people logged into the same machine, that's the best solution for interaction/conversation that I can think of.

[edit]
Hm, check out ytalk (not in the repos).

Last edited by B-Con (2008-02-27 20:55:05)

Offline

Board footer

Powered by FluxBB