You are not logged in.

#1 2010-06-10 17:03:06

leftylink
Member
From: Secure and undisclosed
Registered: 2009-01-25
Posts: 23

[Solved] Proper locking without a display manager

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

#2 2010-06-10 17:05:07

schen
Member
Registered: 2009-06-06
Posts: 468

Re: [Solved] Proper locking without a display manager

Search the forums. Here is a great solution:

http://bbs.archlinux.org/viewtopic.php?id=94535

Offline

#3 2010-06-10 18:24:23

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: [Solved] Proper locking without a display manager

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

#4 2010-06-10 18:56:49

thetrivialstuff
Member
Registered: 2006-05-10
Posts: 191

Re: [Solved] Proper locking without a display manager

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 smile

Offline

#5 2010-06-11 02:35:45

leftylink
Member
From: Secure and undisclosed
Registered: 2009-01-25
Posts: 23

Re: [Solved] Proper locking without a display manager

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

Board footer

Powered by FluxBB