The login logs of ssh users are mainly wtmp and utmp, which are located in the /var/log/ directory and /var/run directory respectively. They are all binary files and cannot be viewed directly with commands such as cat and tail. You need to use four commands, who, w, Users and last, to view them. Let me briefly introduce how to use these four commands to view the login log of ssh users:
who
This command is mainly used to list the users currently logged into Linux system. The output is user name, tty number, login time and remote connection host IP:
If the wtmp file is specified, the who command will list all previous login records as follows: From top to bottom, the time is getting closer and closer, the first login and the last login:
w
This is also a command to display users who have logged into Linux system, mainly used to view utmp files. Compared with WHO commands, it outputs more detailed information, including user name, tty number, remote connection address, login time, idle time and what the current user is doing (executing commands).
user
This command is also mainly used to display the users currently logged into Linux system. One session corresponds to one user. If the user has multiple sessions, it will be displayed multiple times, as shown below:
final
This command is mainly used to display the users who have recently logged into Linux system. The time from top to bottom is getting longer and longer. The latest will be displayed at the top and the farthest will be displayed at the bottom. For wtmp file, the output is as follows: user name, tty device number, remote link address, login time, logout time, etc. If the state is always static, it means that the current user is using a Linux system:
At this point, we have finished using the four commands of who, W, users and last to view the login log of ssh users. Generally speaking, the whole process is very simple. As long as you have a certain Linux foundation and are familiar with the above commands and instructions, you can master it quickly. You can refer to this article. "
② generate a new SSH key to open GitBash, enter the following command, and then press enter three times in succession: ssh-keygen-trsa-c "Your mailbox", and then you will be prompted that there is a path behind Enterfileinwhichtosavethekey, and you will find it. The ssh folder you want.
All of the above are about how to check the installation path of ssh under win 10 system.