[cod] Screen and su question.

Steven Hartland killing at multiplay.co.uk
Tue Jan 11 21:56:38 EST 2005


I don't think you quite understand what pts's are. They are "sudo" files
they there are more like devices than files. They are created dynamically
when you login.
So sshing in as yuk will create a "terminal" pty owned by said user.
This is that sessions "screen" to all intensive purposes. When you logout
it will be "deleted".

There is no problem starting the game processes under screen using
the coduo user. The problem he's seeing is that if said screen is
created in the foreground it instantly tries to write to the "terminal"
as that device is only accessible to the yuk user this fails.

The solution as I said is to start them using -d -m which never tries to
open the "terminal". If you then subsequently want to view the screen
and you logged in as another user and su'ed, just temporally grant
that user access to that sessions "terminal" with chmod e.g.
chown coduo /dev/pts/6

    Steve / K
  ----- Original Message ----- 
  From: Jay Vasallo 
  To: cod at icculus.org 
  Sent: Wednesday, January 12, 2005 12:44 AM
  Subject: Re: [cod] Screen and su question.


  Well he shows two users. 

  Using username "yuk".

  Authenticating with public key "imported-openssh-key" from agent

  [yuk at yoda yuk]$ su -

  Password:

  [root at yoda root]# su - coduo -c screen

  Cannot open your terminal '/dev/pts/6' - please check.

  [root at yoda root]# ls -la /dev/pts

  totaal 148

  drwxr-xr-x   2 root root      0 jan 11  2005 .

  drwxr-xr-x  25 root root 147456 jan 11 22:22 ..

  crw--w----   1 cod  tty  136, 0 jan 11 22:58 0

  crw--w----   1 yuk  tty  136, 1 jan 11 22:59 1

  crw--w----   1 root tty  136, 2 jan 11 22:53 2

  crw--w----   1 yuk  tty  136, 3 jan 11 22:59 3

  crw-------   1 yuk  tty  136, 4 jan 11 22:59 4

  crw--w----   1 yuk  tty  136, 5 jan 11 23:00 5

  crw--w----   1 yuk  tty  136, 6 jan 11 23:00 6

  [root at yoda root]# tty

  /dev/pts/6





  He is probably the one using them all with this script of his. If he is the only one..I say delete them and start over. Screw trying to figure out why one user can't use the other one. Have the same user start the same screen. Looks like he did a "userdel" while he had open screens. I have done this myself...so I say delete them, start his server. But of course everyone wants to make a science project out of starting a simple coduo server.

    ----- Original Message ----- 
    From: Steven Hartland 
    To: cod at icculus.org 
    Sent: Tuesday, January 11, 2005 6:29 PM
    Subject: Re: [cod] Screen and su question.


    LOL
    Erm dont delete them /me slaps Jay around with some skills :P

    They are owned by a different user as that's the user u logged in as.

    Your "terminal" is always owned by the user u log in as. This is to prevent
    other people reading your "screen".
    What I suspect u really want to do is to create a server under screen
    to do this use -m -d e.g.
    su - coduo -c "screen -m -d <server command>"

    Now if u want to login like u have and reconnect to see whats happening
    you will need to give said user access to your "terminal". To do this
    just use chown or chmod. Once your done dont forget to either:
    1. undo the permission changes
    2. logout totally and then reconnect ( u get a new "terminal" ).

        Steve / K

    ----- Original Message ----- 
      From: Jay Vasallo 
      To: cod at icculus.org 
      Sent: Tuesday, January 11, 2005 10:56 PM
      Subject: Re: [cod] Screen and su question.


      Delete them and start again.
        ----- Original Message ----- 
        From: yuk 
        To: cod at icculus.org 
        Sent: Tuesday, January 11, 2005 4:03 PM
        Subject: [cod] Screen and su question.


        Hi Guys,

         

        With great joy I have read all the posts in this lists and most of the information is very valuable! Thank you all for that.

         

        Now, the time has come that I need some help. 

         

        I want to use screen to monitor my server and have created a script to start it. However, I have a problem with screen which I do not know how to solve. It's probably something trivial, but my UNIX knowledge is not so great yet so I am quite stuck. Below is a snip let of what I wanted to do and does not work.

         

         

        Using username "yuk".

        Authenticating with public key "imported-openssh-key" from agent

        [yuk at yoda yuk]$ su -

        Password:

        [root at yoda root]# su - coduo -c screen

        Cannot open your terminal '/dev/pts/6' - please check.

        [root at yoda root]# ls -la /dev/pts

        totaal 148

        drwxr-xr-x   2 root root      0 jan 11  2005 .

        drwxr-xr-x  25 root root 147456 jan 11 22:22 ..

        crw--w----   1 cod  tty  136, 0 jan 11 22:58 0

        crw--w----   1 yuk  tty  136, 1 jan 11 22:59 1

        crw--w----   1 root tty  136, 2 jan 11 22:53 2

        crw--w----   1 yuk  tty  136, 3 jan 11 22:59 3

        crw-------   1 yuk  tty  136, 4 jan 11 22:59 4

        crw--w----   1 yuk  tty  136, 5 jan 11 23:00 5

        crw--w----   1 yuk  tty  136, 6 jan 11 23:00 6

        [root at yoda root]# tty

        /dev/pts/6

         

         

        In bold, you can see that the screen command fails because it cannot open the /dev/pts/6 pseudo terminal. That is correct because that terminal is owned by the user YUK not the user CODUO which I have su'ed to before calling screen.

         

        If anyone can help me out I would really appreciate it.

         

        Kind regards,

        Yuk.


    ================================================
    This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

    In the event of misdirection, illegible or incomplete transmission please telephone (023) 8024 3137
    or return the E.mail to postmaster at multiplay.co.uk. 

================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

In the event of misdirection, illegible or incomplete transmission please telephone (023) 8024 3137
or return the E.mail to postmaster at multiplay.co.uk.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/cod/attachments/20050112/4dd6d1e5/attachment.htm>


More information about the Cod mailing list