JP Vossen on 20 Feb 2012 22:48:03 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] GNU Screen follow-up


Thanks to Gary for the very interesting PLUG W talk on GNU screen. Screen is one of those programs that is absolutely essential, yet many people don't know it exists and when they find it, they learn 5-10% of the features and that's it. I don't even know how many years I've used it (8-10 at least), yet I still learned a bunch from the talk.

See also: http://en.wikipedia.org/wiki/GNU_Screen

Some other things to look into, if you like screen:

http://kmandla.wordpress.com/2010/01/03/byobu-a-shortcut-to-a-prettier-screen/
http://en.wikipedia.org/wiki/Byobu_%28software%29
https://launchpad.net/byobu

http://sourceforge.net/projects/screenie/

http://blog.dustinkirkland.com/2009/01/screenbin-like-pastebin-but-for-screen.html
https://launchpad.net/screenbin


http://tmux.sourceforge.net/: "is intended to be a modern, BSD-licensed alternative to programs such as GNU screen."


I talked about multi-user 'screen' as a great training or t-shooting aid, but there are some hoops you have to jump through first.

* /tmp/screens or /tmp/uscreens must exist and be world readable and executable. (Fix: mkdir -m 1755 /tmp/screens as root) * The screen binary must be SUID root so it can write to the appropriate user dev pseudo terminals (tty) for multiuser mode. If screen doesn't work, especially in multiuser mode, this is a likely reason why. (Fix: chmod u+s /usr/bin/screen as root) * Screen versions from 3.9.15-8 to 4.0.1-1 from Red Hat (i.e. RHEL3) are totally broken and should not be used if you actually want multiuser mode to work. 4.0.2-5 or later should work. http://mirror.centos.org/centos/4.7/os/i386/CentOS/RPMS/screen-4.0.2-5.i386.rpm works even on RHEL3, though once you start using the new screen, existing screen sockets in $HOME/.screen are not found and thus orphaned and unusable. Log out of all sessions, and use the new version to create new sockets in /tmp/screens/S-$USER', then remove the $HOME/.screen directory.

Multi User/Training

Based on simplifications and corrections to the page that used to exist here: http://www.dangerous-minds.net/modules.php?op=modload&name=phpWiki&file=index&pagename=HT-Linux-screen.

1) As the "host"
    1 screen -S {name of session, no spaces}, e.g. screen -S training
    2 Turn on multi-user mode: CTRL-a:multiuser on
3 CTRL-a:addacl {usernames} of accounts (comma delimited, no spaces!) which may access the display. Note this allows full read/write access! E.g. CTRL-a:addacl alice,bob,carl 4 Use the CTRL-a:chacl {usernames} {permbits} {list} command to refine permissions if needed.
2) As the "viewer"
1 Use screen -x {user}/{name} to connect to a shared screen, e.g. screen -x jp/training
    2 CTRL-aK<code> to kill the window and end the session.

Note that 1.2 and/or 1.3 can easily be added to your ~/.screenrc file, if you use them a lot. But at least 1.3 can also be a security leak, since it allows these other uses to see what you're doing.



Finally, a bit OT, but we talked about it at dinner, this is fascinating reading: http://en.wikipedia.org/wiki/Rsync Fred, according to Wikipedia: "Initial release June 19, 1996" so our mid-1990s guess was right.

Later,
JP
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|      http://bashcookbook.com/
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug