← 返回命令列表

Linux command

login 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Log in

login [user]

Example

login -f [user]

Example

login -p [user]

Example

login -h [host] [user]

说明

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.

参数

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

FAQ

What is the login command used for?

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.

How do I run a basic login example?

Run `login [user]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f do in login?

Skip authentication (for preauthenticated users)