Инструменты пользователя

Инструменты сайта


lock_terminal

Блокировка терминала

Временная блокировка текстового терминала позволяет избежать необходимости выполнять выход из активной сессии или отключаться от удалённого узла, так как в текущей сеансе могут выполняться приложения или находится активные задачи.

UNIX

В поставку большинства OS UNIX1) входит утилита lock. Достаточно запустить её и экран окажется заблокирован до ввода правильного пароля, либо до истечения указанного при запуске временного интервала.

man lock

man lock

man lock

 Commands Reference, Volume 3, i - m

lock Command

Purpose

       Reserves a terminal.

Syntax

       lock [ -Timeout ]

Description

       The lock command requests a password from the user, reads it, and requests the password a second time to verify it. In the interim, the command locks the terminal and does not relinquish it until the
       password is received the second time or one of the following occurs:
       *    The timeout interval is exceeded.
       *    The command is killed by a user with appropriate permission.

       The timeout default value is 15 minutes, but this can be changed with the -Timeout flag.

Flags

       -Timeout
            Indicates the timeout interval in minutes, as specified by the Timeout parameter. The default value is 15 minutes.

Examples
       1    To reserve a terminal under password control, enter:

            lock

            You are prompted for the password twice so the system can verify it. If the password is not repeated within 15 minutes, the command times out.
       2    To reserve a terminal under password control, with a timeout interval of 10 minutes, enter:

            lock -10

Files

       /usr/bin/lock
            Contains the lock command.

Related Information

       The passwd command.

       For more information about the identification and authentication of users, discretionary access control, the trusted computing base, and auditing, refer to the Security.


Linux

В OS Linux есть утилита vlock (разработана Michael K. Johnson), которая также позволяет заблокировать доступ к текстовому терминалу до того момента, когда будет введёт правильный пароль.
К сожалению, vlock не входит в «стандартную» поставку большинства дистрибутивов Linux. Потребуется выполнить самостоятельную установку.

man vlock

man vlock

man vlock

VLOCK(1)                                                              VLOCK(1)

NAME
       vlock - Virtual Console lock program

SYNOPSIS
       vlock

       vlock [ -a,--all ] [ -c,--current ] [ -h,--help ] [ -v,--version ]

DESCRIPTION
       vlock  is  a  program to lock one or more sessions on the Linux console.  This is especially useful for Linux machines which have multiple users with access to the
       console.  One user may lock his or her session(s) while still allowing other users to use the system on other virtual consoles.  If desired, the entire console may
       be locked and virtual console switching disabled.

       By  default, only the current VC (virtual console) is locked.  With the -a,-all option all VCs are locked.  The locked VCs cannot be unlocked without the invoker’s
       password or the root password.  The root password will always be able to unlock any or all sessions.  And, for the paranoid, vlock makes it a trying experience for
       those attempting to guess the password, so unauthorized access to session(s) is highly unlikely.

       Please  note that it is entirely possible to completely lock yourself out of the console with the -a,--all option if you cannot remember your password!  Unless you
       are able to kill vlock by logging in remotely via a serial terminal or network, a hard reset is the only method of ‘‘unlocking’’ the display.

       vlock works for console sessions primarily.  However, there is support for trying to lock non-console sessions as well, but that support has not been well  tested.

OPTIONS
       -a,--all

              Lock all console sessions and disable VC switching.

       -c,--current

              Lock the current session (this is the default).

       -h,--help

              Print a brief help message.

       -v,--version

              Print the version number of vlock.

AUTHOR
       Michael K. Johnson <johnsonm@redhat.com>
       
Linux User’s Manual               16 May 1996                         VLOCK(1)
1) IBM AIX®, Oracle Solaris, *BSD
lock_terminal.txt · Последние изменения: 2015/04/02 11:03 — Alex