1756705 Members
2322 Online
108852 Solutions
New Discussion юеВ

Can a tty be locked?

 
SOLVED
Go to solution
Darrell Allen
Honored Contributor

Can a tty be locked?

Is there some way to lock a tty session whether it be just a dumb terminal, a terminal emulation program, or even a dtterm or xterm window?

Thanks,

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
5 REPLIES 5
John Wright
Occasional Contributor
Solution

Re: Can a tty be locked?

Darrell,

You could try lock which will prompt for a password that will unlock the terminal.
see man 1 lock

John
A. Clay Stephenson
Acclaimed Contributor

Re: Can a tty be locked?

Sorry Darrell, I don't think this dog will hunt in a general purpose way. Of course, there is the trivial case of the CDE screen lock but I've been thinking through the system calls and there just is no generalized way to do this.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Can a tty be locked?

Hi:

John's approach will certainly work if the user is at the shell but for the general case where the user is within an application, lock cannot be invoked.

If it ain't broke, I can fix that.
Alexander M. Ermes
Honored Contributor

Re: Can a tty be locked?

Hi there.
A tty will not be accessible, if you change the rights to 444.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Darrell Allen
Honored Contributor

Re: Can a tty be locked?

Thanks all,

John, that's what I was looking for. It's been several years since I used it and I had forgotten it.

Clay, I hadn't even thought about the user being in a application. I was particularly thinking of my own session and I'm generally at the shell.

Alexander, where you referring to chmod on the /dev/tty/... file itself? I tried it (even went to 000 and chown root) but I was still able to use the tty session (as a non-root user).

When the dog won't hunt, sell him to your neighbor!

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)