Posts Tagged ‘lock’

How to Lock Your Machine and Display Application Screen

Friday, September 24th, 2010

We have a couple monitoring applications running on our Linux desktop. To monitor server health, graph utilization through various network monitoring systems. Usually monitoring application required authentication and it will be a security issue if you left your Linux desktop unlock.

But if you lock your Linux desktop, the screen will goes blank and you can’t monitor what is projected on your screen. There is a way to do it with screen saver lock, where you can lock your Linux desktop and at the same time to display when application is running on your monitoring screen.

Lock Your Machine with xlock

First, install xlock in your Linux desktop


shell> sudo apt-get install xlock

After xlock has been install, create a file name lockscreen, chmod to 777 and paste the line below in the file


# /usr/bin/xlock -mode image -geometry 0x0 -timeout 1
shell> vi lockscreen
shell> chmod 755 lockscreen

xlock is screen saver lock, but it can disable the screen saver screen by setting display with “-geometry 0×0″.

You can also bind your keyboard short cut key to launch the lockscreen script through System > Preferences > Keyboard Shortcuts.

How to Create User with useradd in FreeBSD

Friday, July 9th, 2010

You can invoke “adduser” command in FreeBSD in order to create new user. Adduser will prompt you for user info like name, uid, gid, shell environment and etc. But sometime we would like to create user access through Bash script. “useradd” command is the good way to do it.

In Linux, using “useradd” is pretty common for creating new user access. You can also use “useradd” in FreeBSD, but not directly invoke “useradd” command. Below is the sample of creating new user in FreeBSD with “useradd”.


shell> pw useradd cheryl -c 'Cheryl Windows Admin' -d /home/cheryl -s /usr/local/bin/bash

New user account is created, but don’t forgot to set password for the account


shell> passwd cheryl

You can run other command like “userdel”, “usermod”, “usershow”, “groupadd”, “groupdel”, “groupmod”, “lock”, “unlock” on FreeBSD by using the “pw” command.