Code Monkey home page Code Monkey logo

physlock's Introduction

Physlock extended to support displaying /etc/issue

Basically, the same as Physlock except it reads and shows the contents of whatever is in /etc/issue. Cool for awesome ANSI art lock screens!

A sample has been provided of Ryu from https://git.io/ryucolor, but adjusted to fit 1080p screens better!

Additionally we are able to replace escape sequences, similarly to those support by agetty(8), with:

Escape Sequence Result
\m Print machine architecture (e.g. x86_64)
\n Print machine name
\r Print OS version
\s Print OS name
\v Print OS extra info
\d or \t Display date in ISO-8601 format or HH:MM:SS
\l Print tty number (e.g. "tty1", etc.)
\u or \U Print number of users logged in (including you)

About

Control physical access to a linux computer by locking all of its virtual terminals.

physlock only allows the user of the active session (the user logged in on the foreground virtual terminal) and the root user to unlock the computer and uses PAM for authentication.

physlock uses 3 mechanisms to detect the user of the active session:

  1. Querying systemd-logind(1) or elogind(8) if compiled with either HAVE_SYSTEMD=1 or HAVE_ELOGIND=1
  2. Searching the utmp file for an entry whose ut_line field is the base name of the active tty device file
  3. Using the owner of the active tty device file typically set by login(1)

Installation

physlock is build using the commands:

$ make
# make install

Please note, that the latter one requires root privileges. By default, physlock is installed using the prefix /usr/local, so the full path of the executable will be /usr/local/bin/physlock.

You can install it into a directory of your choice by overwriting the PREFIX macro in the second command:

# make PREFIX="/your/dir" install

Please also note, that the physlock executable will have root ownership and the setuid bit set.

All build-time specific settings are set in the file config.h. Please check and change them, so that they fit your needs. If the file config.h does not already exist, then you have to create it with the following command:

$ make config.h

You also have to make sure that physlock works with your PAM configuration. If you have a restrictive PAM fallback config file /etc/pam.d/other, then you need to create a suitable PAM config file for physlock named /etc/pam.d/physlock. The sample physlock.pam should work for most users.

Usage

The behaviour of physlock is completely controlled via command-line arguments, it does not rely on environment variables. physlock uses the utmp file to identify the owner of the current session (i.e. active tty) and prompts for her password to unlock the computer.

The following command-line arguments are supported:

-d       fork and detach, parent returns after everything is set up
         (useful for suspend/hibernate scripts)
-h       print short usage help and exit
-l       only lock console switching
-L       only enable console switching
-m       mute kernel messages on console while physlock is running
-b CMD   execute CMD before the password prompt
-a CMD   execute CMD after successfully authenticating
-n       don't actually authenticate: just execute commands
-p MSG   Display MSG before the password prompt
-s       disable sysrq key while physlock is running
-u       print username above prompt
-v       print version information and exit
-z       disable printing the /etc/issue file

physlock's People

Contributors

c-er avatar cruegge avatar dexterlb avatar elboulangero avatar fluffeecode avatar hv15 avatar jwilk avatar mcbridet avatar menglishca avatar spacefrogg avatar travankor avatar tstsrt avatar xyb3rt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.