You are not logged in.
Hey Arch users,
I'm a somewhat security-minded guy and I like to have my computer be locked when unattended.
I currently use xscreensaver for this. This works great, but the problem is someone could just hit Ctrl Alt F1 and then Ctrl C to kill X. This is because I do not use a display manager; I log in on a text terminal and just use startx to start my window manager.
After I found this potential "loophole", my current solution is to use startx in the background (startx &, or Ctrl Z and bg), and then vlock the terminal so that nobody can Ctrl C out of X without knowing my password (or the root password). Then xscreensaver locks my X session.
I was wondering if any Archers knew of any more elegant solutions, preferably without using a display manager. I'd appreciate any input.
Last edited by leftylink (2010-06-11 02:35:58)
Offline
Search the forums. Here is a great solution:
Offline
Another way of doing this (the way I do it), is to "exec" startx instead of just running it. That way, there's no shell running in that TTY to drop back into - if somebody hits Ctrl-C they will just get the login prompt. It also prevents Ctrl-Z as well.
I actually use this at the end of my .bash_profile for some comfortable automation:
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
exec /usr/bin/startx >> $HOME/.xsession-errors 2>&1
fi
Offline
I have my laptop set up this way (because sometimes I want a *really* fast boot just to jot down some notes in a text editor). When I want X, all I do is:
(startx &); logout
Which starts X and immediately logs out. Usually I don't have to type all that; using bash's ctrl+r and typing "(s" is good enough, since it was usually the last command I ran with parens and an 's' at the front
Offline
Hey, I like thetrivialstuff's solution. I will mark the topic as solved.
As a small adjustment, I added ssh-agent in front because I ssh into other computers often.
(ssh-agent startx &); logout
Works well enough. Thanks for the suggestions.
Last edited by leftylink (2010-06-11 02:40:03)
Offline