Sometimes we take a break in a company and we don’t want anyone to look or change our commands on current terminal we are working on or someone borrows our system for a minute and wants to practice but we don’t want him to look on what we are working on , On that scenarios VLOCK command is useful . Vlock is a utility used to lock one or several terminals in linux . Vlock is important on a multi user system, it allows users to lock their own terminals while other users can still use the same system via other terminals.
- Install package which is required for vlock .
[root@localhost ~]# yum install vlock* Loaded plugins: rhnplugin, security Repository 'a' is missing name in configuration, using id This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package vlock.i386 0:1.3-23 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================== Package Arch Version Repository Size ============================================================================================================== Installing: vlock i386 1.3-23 a 11 k Transaction Summary ============================================================================================================== Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 11 k Is this ok [y/N]: y
- Yum installer calculate file size . It will ask you whether you wanna install it or not . Type y and hit Enter .
Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : vlock 1/1 Installed: vlock.i386 0:1.3-23 Complete!
- To lock terminal which you are currently working on . Type below commands .
- After typing command it will ask you root (admin) password .
[root@localhost ~]# vlock -c *** This tty is not a VC (virtual console). *** *** It may not be securely locked. *** This TTY is now locked. Please enter the password to unlock. root's Password:
- Now to lock all terminals , type below commands .
- And also give root password to lock all terminals .
[root@localhost ~]# vlock -a *** This tty is not a VC (virtual console). *** *** It may not be securely locked. *** This TTY is now locked. Please enter the password to unlock. root's Password: