• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

login: command not found

by Deepika

The login utility logs users (and pseudo-users) into the computer system. If no user is specified, or if a user is specified and authentication of the user fails, login prompts for a user name. Authentication of users is configurable via pam. Password authentication is the default.

If the file /etc/nologin exists, login displays its contents to the user and exits. This is used by shutdown(8) to prevent users from logging in when the system is about to go down.

If you encounter the below error while running the command login:

login: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install login
Ubuntu apt-get install login
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install login
CentOS yum install util-linux
Fedora dnf install util-linux
OS X brew install util-linux
Raspbian apt-get install login

login Command Examples

1. Log in as a user:

# login user

2. Log in as user without authentication if user is preauthenticated:

# login -f user

3. Log in as user and preserve environment:

# login -p user

4. Log in as a user on a remote host:

# login -h host user

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Install awscli
  2. readelf Command Examples in Linux
  3. bc: An arbitrary precision calculator language (Command Examples)
  4. c99 – Compiles C programs according to the ISO C standard
  5. fastboot Command Examples
  6. chars: Display names and codes for various ASCII and Unicode characters and code points
  7. tail command examples in UNIX/Linux
  8. named Command Examples in Linux
  9. arch Command – Display the name of the system architecture (Command Examples)
  10. How to use strace and ltrace commands in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright