LinuxCommandLibrary

login

initiates a user session on the system

TLDR

Log in as user

$ login [user]
copy
Log in without authentication
$ login -f [user]
copy
Log in preserving environment
$ login -p [user]
copy
Log in from remote host
$ login -h [host] [user]
copy

SYNOPSIS

login [options] [username]

DESCRIPTION

login initiates a user session on the system. It authenticates users, sets up the environment, and starts a shell. This command is typically invoked by init or a terminal program.

PARAMETERS

-f

Skip authentication (for preauthenticated users)
-p
Preserve environment variables
-h HOST
Specify remote hostname (for remote logins)

CAVEATS

Direct invocation is restricted to root or when called from specific programs. The -f option is only available to root. PAM modules control authentication behavior.

HISTORY

The login command dates back to the original Unix systems at Bell Labs in the 1970s, providing the fundamental user authentication mechanism.

SEE ALSO

su(1), sudo(8), passwd(1), getty(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community