Tag:服务器 linux
Article From:https://www.cnblogs.com/panda-blog/p/9124184.html

After entering a server backstage, I still have to think about excitement.How to slip in and slip out without a sound.

Do not say much, direct command.

1、Use the last command to check the login status of this server and know who its owner is (IP).


2、Hide the login information

#touch ~/.hushlogin

Interpretation: when you log in with the last different IP, you will be prompted to log in the last login information, and the command will not be executed, but it can be found with the last command.

Or modify the SSH configuration file

#vim /etc/ssh/sshd_config

#PrintLastLog yes Change to PrintLastLog no

#/etc/init.d/sshd restart Restarting service

3、Look at the port number of the server monitoring and know what services have been opened.

#netstat -lntp

Here we need to rely on our own judgement of what services we have. We can record our own services (such as comic).

4、View partition information

#df -h

If the disk is very small, it may be a virtual machine

5、Look at CPU information

#cat /proc/cpuinfo

6、Quietly acting as an agent, but note that log files may leave traces.

Others want to do something about it and think about it.

7、Clear some logs

#sed -i ‘/’ test.log
Delete rows containing in the test.log file to remove rows related to IP.

You can use scripts to traverse all possible log files and then clear them.

8、Clear the command of your operation, which needs to be disconnected and then logon again, because the command in the command log file does not save this login operation command.

#vim ~/.bash_history

shift+GPosition to the last line and clear your commands.

Then you can copy the previous commands of the server owner and run it, which is more realistic.


ps:Of course, you can’t completely hide the login information, and find the inadequacies to update it.

For reference only, if there is a mistake to be corrected.

Leave a Reply

Your email address will not be published. Required fields are marked *