I'm trying to create a new screen
on my server (CentOS 5.11), but instead of starting it with my user, I would prefer to use another user with restricted permissions, just to be on the safe side.
So, after reading a bit about the reason of screen inside script this seemed easy:
sudo su - <user> bash
script /dev/null
screen -c .screenrc -d -m -S testN ping google.com
exit
and everything worked fine. I was able to access it even with screen -x <user>/testN
(meant to be used by 3 or 4 users of the machine). So, all in one line should be...
sudo su - <user> bash -c 'script -c "screen -c .screenrc -d -m -S testN ping google.com; exit;" /dev/null'
but (now) for some reason, when I do sudo su - <user> bash -c 'screen -ls'
the screen is dead and I'm not able to attach that screen as before.
There is a screen on: 24120.testN (Dead ???) Remove dead screens with 'screen -wipe'.
Did anyone encounter a similar problem? Any ideas about an easier way, will be welcome.
My .screenrc
is just a configuration which sets the screen to be accesible by other users, doesn't seems to have any relation with the problem.