[nycbug-talk] X and screen. was: BSD on a desktop
Sun Aug 1 17:09:05 EDT 2004
On Sun 2004.08.01 at 07:13 -0400, michael wrote:
> on 20040731 2:04 PM pete wright had written...
> >hey marc,
> > here is a dumb question...can you run say Xterm in a screen session,
> >detach the session (along with xterm) then re-attach the session
> >somewhere else and have the xterm come back. i've tried it out, but
> >have a feeling that it's not possible or i'm missing a swtich somewhere.
> I'm also a big fan of screen. The 2 main situations I use it are
> 1.) ssh into a remote server- start a screen session - do stuff, maybe
> kick off a long compile, dettach. I can then go to work- ssh into that
> server and reattach. The process has been running and I can pick up
> where I left off.
> 2.) I was uncomfortable with running x on a workstation then walking
> away. Anyone could kill the session and drop down to a prompt... with
> my credentials. So, I actually use it everytime I run startx. May
> would say a common solution would be to use a display manager like XDM,
> KDM, GDM but.. Common solutions are not always the right ones or the
> most secure ones. I may be wrong, but, as far as I know:
and only in the spirit of alternatives, one may start x, backgrounded,
and exit from the console:
then exit shell
<crtl><f4> or <f7> depending on your setup
> -- Display mgrs require you to run X.. there are many times I just don't
> want to
> -- Display mgrs require you to launch X as root.
> -- Display mgrs control your machine.. it is very difficult to close X
> and drop to a prompt... say, if you were going to do a large compile and
> wanted to free up some overhead
> I wanted to secure my workstation, but, I didn't want to loose access to
> my console altogether.
> Option "DontVTSwitch" "true"
> Option "DontZap" "true"
> ... would have required a reboot in case something went wrong with X.
> Disabling "magic sysreq key" and ctrl+alt+del could also lock me out of
> my own box... except for the Power button and the wall plug.
> My answer was to use a very familiar utility called 'screen'.
> 1) I logon as a user (not root)
> 2) type 'screen', and I'm given a new prompt
> 3) at the new prompt I type 'startx'. Which ever WM/DE is set in the
> .xinitrc loads (KDE, GNOME, fluxbox...etc).
> 4) <CTRL><ALT><F1> takes me back to the 'screen' prompt.
> 5) "<CTRL><A> d" to detach ('man screen' for more) and I'm back at the
> original prompt.
> 6) from here I can 'logout'... the logon prompt appears.
> 7) <CTRL><ALT><F7> takes me back to the WM/DE
> I only have to do this once for each re-boot, which is not often.
> Now I can use any X screensaver/lock I choose. I can walk away from my
> desk knowing X is locked and the box is secured. Without my password,
> noone can use my credentials. If they need the box, they can log in
> themselves. I can also recover from any X mishaps more gracefully than a
> talk mailing list
> talk at lists.nycbug.org
> % Be sure to check out our Jobs and NYCBUG-announce lists
> % We meet the first Wednesday of the month
Okan Demirmen <okan at demirmen.com>
PGP-Fingerprint: 226D B4AE 78A9 7F4E CD2B 1B44 C281 AF18 B367 0934
More information about the talk