LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 06-29-2005, 06:52 AM   #1
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Rep: Reputation: 30
Problem using screen: Cannot open your terminal '/dev/pts/0' - please check.


using the command

screen ./start.sh on my shell script as a non root user

I am in the user's home directory and the user has full perms on the file, works fine without screen.

but with screen I get the following error:

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

Thx
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-29-2005, 09:32 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Now why would you use screen with a command after it? First you invoke screen and then run your commands..

$ screen
$ commands-here
<ctrl-a then ctrl-d> to detach
$ screen -r <to reattach to running screen session>

And the error your getting, sounds like a permissions issue, what is the exact command your using?
 
Old 06-29-2005, 04:09 PM   #3
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
running 'screen command' executes that command in the screen.. a pretty nifty feature imo..

Now, ive seen that error before, and that was when Ihad 'su'd to another user, then tried to attach a screen of the new user. Have you tried doing the same from a login shell?
 
Old 06-29-2005, 08:25 PM   #4
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
Yeah indeed, if I login with the user immediately through SSH it seems to work.

I had logged in as root and then su'ed to it.

Cheers
 
Old 06-30-2005, 04:14 AM   #5
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
I guess its some method of protecting the user's screens from spying roots.. (;

Tho if there is a way around it, id be very interested in it.. d:
 
Old 06-30-2005, 09:56 AM   #6
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally posted by Artanicus
I guess its some method of protecting the user's screens from spying roots.. (;

Tho if there is a way around it, id be very interested in it.. d:
As the owner and user of the pts, simply allow others read/write access by chmodding it..
 
3 members found this post helpful.
Old 06-30-2005, 10:23 AM   #7
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
Quote:
Originally posted by trickykid
As the owner and user of the pts, simply allow others read/write access by chmodding it..
Wow, it actually works.. Thanks alot.. (: Now I can better spy on unsuspecting rulebreakers.. (;
 
Old 12-24-2008, 11:43 AM   #8
archon810
LQ Newbie
 
Registered: Dec 2006
Location: Bay Area, CA
Distribution: openSUSE 11.1
Posts: 14

Rep: Reputation: 0
I've been trying to figure this out for a while now. Your solution worked like a charm and makes a lot of sense.
 
Old 06-15-2009, 06:25 PM   #9
sideshowmel
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by trickykid View Post
As the owner and user of the pts, simply allow others read/write access by chmodding it..
I'm not a n00b I swear... but hey, I'm asking a n00b question today.

So... exactly how would I allow access to that session? just do a :

$ sudo chmod 777 /dev/pts/3

(or whatever desired permission level... 777 is probably a bad idea but you get the point)? Thanks.

or would I just want to add root to the user's group and allow the entire group with chmod? thusly:

$ sudo adduser root user1group
$ sudo chmod 770 /dev/pts/3

? Or am I missing something here? Thanks.
 
Old 08-30-2009, 07:46 PM   #10
mr_grumpy
LQ Newbie
 
Registered: Aug 2009
Location: Australia
Distribution: F12, RHEL 5.5
Posts: 6

Rep: Reputation: 2
Quote:
Originally Posted by sideshowmel View Post
I'm not a n00b I swear... but hey, I'm asking a n00b question today.

So... exactly how would I allow access to that session? just do a :

$ sudo chmod 777 /dev/pts/3
$sudo chmod o+rw /dev/pts/3

This sets "others" to have read / write, and doesn't change any other permissions

Quote:
Originally Posted by sideshowmel View Post

or would I just want to add root to the user's group and allow the entire group with chmod? thusly:

$ sudo adduser root user1group
$ sudo chmod 770 /dev/pts/3

? Or am I missing something here? Thanks.
No need. Root can already access the device (and all of user1's files). The problem is user1 can't read/write the device
 
1 members found this post helpful.
Old 10-02-2009, 06:42 AM   #11
okki
LQ Newbie
 
Registered: Oct 2009
Posts: 1

Rep: Reputation: 0
Thumbs up Thanks

Just created a login for this forum to be able to thank all contributors to this thread!

Thanks.
 
Old 10-23-2009, 03:35 AM   #12
sebastjanp
LQ Newbie
 
Registered: Oct 2009
Posts: 1

Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by okki View Post
Just created a login for this forum to be able to thank all contributors to this thread!

Thanks.
Same here thanks everybody.
 
Old 01-30-2010, 06:09 PM   #13
dragon_788
LQ Newbie
 
Registered: Jul 2003
Distribution: VMs of as many as possible, Ubuntu/openSUSE most often
Posts: 3

Rep: Reputation: 0
Thanks guys, this helped me out today while trying to figure out how to run a program in screen as another user, I found the command elsewhere on LQ and the fix was here too, w00t!
 
Old 03-11-2010, 11:48 AM   #14
obiwahn
LQ Newbie
 
Registered: Mar 2010
Location: germany
Distribution: debian sid, e17
Posts: 2

Rep: Reputation: 0
Instead of su you could use ssh to gain access to the 2nd user's account to avoid security problems. No root privs required.

ssh user2@localhost -t screen


some sugar:

as user 2:

create:
./bin/screen-cmd ------------------
#!/bin/bash
cmd=$(basename $0|sed 's/^.*-//')
screen -S $cmd -c ~/.screenrcs/$cmd
-----------------------------------

cd .bin
ln -s screen-cmd screen-log

mkdir ~/.screenrcs

create screen config files like

.screenrcs/log -------------------
screen -t syslog tail -f /var/log/syslog
screen -t cs tail -f /var/log/hl-server.log # <<< q3 promode
-----------------------------------

as user1 add this bash alias to your bashrc:
alias log='ssh log@localhost -t "screen -rd -S log || /home/user2/.bin/screen-log'

log into a new bash

DONE

Now you can call as user1 the command log
this will ssh into the account of user2 and attach to a screen called log. If this screen is not existent it will create a screen called log with the options specified in .screenrcs/log

hurray

Last edited by obiwahn; 03-11-2010 at 11:49 AM.
 
Old 08-20-2010, 02:39 AM   #15
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
I ran across this problem *again* today .... after a little digging I found you can also run it like this:

Code:
su - <user> -c "screen -d -m ${APPHOME}/${PROG}"
cheers
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
su - user : /dev/pts/# Operation not permitted problem buaku Slackware 4 10-16-2005 09:08 PM
Normal users can't open /dev/pts/x wartstew Debian 2 10-03-2005 01:05 AM
Kernel config options (/dev, /dev/pts) jrdioko Slackware 5 08-22-2005 02:25 AM
What is /dev/pts, /dev/shm? mrpc_cambodia Red Hat 1 10-18-2004 04:27 AM
rxvt: can't open slave tty /dev/pts/3 kater Linux - General 2 02-26-2003 07:39 PM


All times are GMT -5. The time now is 07:47 PM.

Main Menu
Advertisement
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