Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-02-2009, 06:26 AM   #1
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Question Having Problem re-attaching to an attached "screen", any ideas?

Hi All,

When i try to re-attach my screen which is definitely there somewhere, i get a less than helpful error message. Has anyone come across it before, or had similar issue?

user1@hostname> screen -ls
There is a screen on:
	23127..hostname	(Detached)
1 Socket in /var/run/uscreens/S-user1.

user1@hostname> screen -r
Cannot open your terminal '/dev/pts/0' - please check.
user1@hostname> screen -r 23127..hostname
Cannot open your terminal '/dev/pts/0' - please check.
user1@hostname> screen -r 23127.`tty`.hostname
Must run suid root for multiuser support.
I know the problem is because i am sshing to root and then 'su - user1'? The "su" causing the issue here...therefore it can't grab the terminal perhaps because its actually root's terminal? OR something like that. But how might it be possible to do this, attach to a screen of a different user from root. It should be possible to:-
screen -r user1/
Cannot access /var/run/screens/S-user1: No such file or directory
But you see the problem here is that root seems to keep it sockets in '/var/run/screens/S-root'
where as user1 (perhaps all standard users), keep their socket details in '/var/run/uscreens/S-user1'

So where is the path set that it making 'user' and 'root' screens/sockets be in a different path. Is this something i can set when trying to get the screen back with "screen -r <path_to_socket>"

Running on SUSE Linux Enterprise Server 10

Old 01-02-2009, 07:16 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,986
Blog Entries: 14

Rep: Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187
You might want to try changing permission on /dev/pts/0 since the initial complaint is it can't open that device.

Presumably /dev/pts/0 is the pseudo-tty you're current login session is on (you can verify by typing "tty" command).

Also pseudo-ttys are used by X programs typically. While it doesn't seem likely to me perhaps your issue is related to Xauthority.

When you ssh into a system using tunneling (see -x and -X options of ssh) it creates a .Xauthority file in your home directory and sets your DISPLAY variable. When you su to root in a tunneled ssh you lose both the DISPLAY and the permissions to .Xauthority as it is restricted to the user that logged in.

There is a way to make it work though:
Do the ssh.
type echo $DISPLAY and save the value you see.
Use chmod to allow access to $HOME/.Xauthority for the user you initially logged in to other users such as root.
su - to new user
type export DISPLAY=<value you saved>
type export XAUTHORITY=<path to your original $HOME/.Xauthority>.
Old 01-02-2009, 08:53 AM   #3
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Hi There,
Thanks for the reply, i've looked at the permissions setting of /dev/pts/0 and chmod to be world accessible just temporarily to see if that did help on this issue, which it un-fortunately didn't so i checked out the .Xauthority file and the DISPLAY variable, the .Xauthority was blank/empty and the DISPLAY variable is un-set.
# cat .Xauthority 
# [[ $DISPLAY ]] && echo 'Var Found'
# echo $DISPLAY

# env | grep DISPLAY

Last edited by helptonewbie; 01-02-2009 at 09:14 AM.


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
Fedora Core 2: Screen Resolution can not change from "800X600" to "1024X 768" suhaimi_sj Fedora - Installation 18 12-17-2009 03:29 AM
How do I disable "shutdown" and "restart" options in KDE logout screen for all users? maxgsp Linux - Distributions 1 12-12-2008 03:18 PM
pl2303 attached to ttyUSB0 but driver attached to device is "serial" sheeluh Linux - Software 4 03-12-2007 04:27 AM
winxp says "unable to connect..." to server attached printer linuxlimbo Linux - Networking 1 09-20-2006 10:39 PM
Slackware 9.1 - "hd* : attached ide-disk driver" Jetti Slackware - Installation 1 02-23-2004 02:12 AM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration