Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the login command under Linux

2025-04-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use the login command under Linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Login

1. Action

The role of login is to log in to the system, and its permissions are for all users.

two。 Format

Login [name] [- p] [- h host name]

3. Main parameters

-p: tells login to keep the current environment parameters. -h: used to transfer user names between remote logins.

If you choose to log in to Linux in command line mode, the * Linux command you see is login:. The general interface looks like this:

Manddrake Linux release 9.1 (Bamboo) for i586 renrel 2.4.21-0.13mdk on i686 / tty1 localhost login:root password:

In the above code, the * line is the Linux release number, and the second line is the kernel version number and the login virtual console. We enter the login name on the third line, press the "Enter" key to enter the account password after Password, and then log in to the system. For security reasons, the characters will not be echoed on the screen and the cursor will not move when entering the account password.

After logging in, you will see the following interface (take superuser as an example):

[root@localhost root] # last login:Tue, Nov 18 10:00:55 on vc/1

Shown above is the virtual console logged in for the week, month, day, time, and use.

4. Application skills

Linux

Is a true multi-user operating system that allows multiple users to log in at the same time and allows a user to log in multiple times. This is because Linux, like many versions of Unix, provides access to the virtual console, allowing users to log in multiple times at the same time from the console (the console of the system is a monitor and keyboard directly connected to the system). Each virtual console can be seen as a separate workstation, which can be switched between workstations. The switching of the virtual console can be achieved by pressing the Alt key and a function key, usually using F1-F6.

For example, after the user logs in and presses the "Alt+F2" key, the user can see the "login:" prompt above, indicating that the user has seen the second virtual console. Then simply press the "Alt+F1" key to return to * virtual consoles. A newly installed Linux system allows users to access the first six virtual consoles using the "Alt+F1" to "Alt+F6" keys. The most useful thing about the virtual console is that when a program goes wrong and causes a system deadlock, you can switch to another virtual console to work and close the program.

Shutdown

1. Action

The function of the shutdown command is to shut down the computer, and its permission is superuser.

two。 Format

Shutdown [- h] [- I] [- k] [- m] [- t]

3. Important parameters

-t: tell the init program how long it takes to shut down before changing to another run level.

K: it doesn't really turn off, it just sends a warning signal to every logger.

-h: turn off the power after shutting down.

-c:cancel current process cancels the currently executing shutdown program. So of course there is no time parameter for this option, but you can enter a message for interpretation, and this information will be sent to each user.

-F: force fsck when restarting the computer.

-time: set the time before shutdown.

-m: change the system to single-user mode.

-I: displays system information when shutting down.

4. Command description

Shutdown: the command can safely shut down the system. Some users will shut down the Linux system by directly cutting off the power supply, which is very dangerous. Because Linux is different from Windows, there are many processes running in the background, so forced shutdown may lead to data loss of processes, make the system in an unstable state, and even damage hardware devices (hard drives) in some systems. Using the shutdown command before the system shuts down, the system administrator will notify all logged-in users that the system is going to shut down, and the login command will be frozen, that is, new users can no longer log in.

This is the end of this article on "how to use login commands under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report