0

I have a Mac with snow leopard. I often work off the terminal using tmux (or GNU screen) When I walk away I remote ssh back to my computer. The thing is sometimes I have to step away from the computer for a minute or two. When that happens I don't want people to glance over and have access to my command line and I also don't think it is worth the whole CTRL-a,d,exit,open terminal, ssh to machine, tmux attach each time that happens.

Screen offered a CTRL-a,x that locked the screen (provided I enter in a password at least once that session because it won't read the system password) or in tmux (preferred) a clock feature.

All the documentation points to the fact that the multiplexers look for /usr/bin/lock or /usr/bin/lck. Since that is a low level utility found on linux and BSD systems where can I find the source so I can port it to Mac OS X?

Sukima
  • 9,965
  • 3
  • 46
  • 60
  • I´m not sure what you´re asking for - entering ctrl-a,x works perfectly in screen on a Mac, why do you want to port lock? Also, using your screensaver with a hot corner to activate might be faster & more secure – Asmus Feb 04 '11 at 00:20
  • Two issues. screen on mac asks for a password instead of using the system password (mild annoyance) but truthfully I use tmux which is dependent on an external program for ctrl-b,x to work. The screen saver is good but will only work when I'm sitting at the computer. Usually it is locked but I'm accessing it from another computer. That's where a quick lock via tmux or ssh would be more convenient then the usual logout log back in setup. – Sukima Feb 07 '11 at 13:09
  • Re: "All the documentation points to...", do you have any links to this documentation? – jjlin Feb 04 '12 at 07:58
  • I was referring to the TMUX and Screen documentation (man pages). – Sukima Feb 26 '12 at 02:02

2 Answers2

2

tmux comes from OpenBSD; you can view its lock through OpenBSD CVSweb for src/usr.bin/lock/.

Mac OS X is more closely related to FreeBSD; you can view its lock code through FreeBSD SVN ViewVC for head/usr.bin/lock/ (CVS and Perforce are also available).

Either one will require modification to even compile on Mac OS X.

A major functionality difference will be in the authentication method for the -p option (“use login password/authentication”): the OpenBSD code uses its own authentication system, and FreeBSD uses crypt(3) which will not work for most Mac OS X accounts.

Chris Johnsen
  • 214,407
  • 26
  • 209
  • 186
0

man -P "less -p lock" tmux, press n until satisfied with results?

Josh McGee
  • 300
  • 2
  • 5