[Comprehensive explanation of Linux commands] 133. Introduction to network management tools and detailed explanation of common commands

apachectl

Apache server front-end control tool

Additional information

apachectlThe command is Apache's web server front-end control tool, used to start, shut down, and restart the web server process.

grammar

apachectl (参数)

parameter

  • configtest: Check whether the syntax in the settings file is correct;
  • fullstatus: Display the complete status information of the server;
  • graceful: Restart the Apache server without interrupting the original connection;
  • help: Display help information;
  • restart: Restart the Apache server;
  • start: Start the Apache server;
  • status: Display server summary status information;
  • stop: Stop the Apache server.

arpwatch

Monitor ARP records on the network

Additional information

arpwatchThe command is used to monitor arp records on the network.

grammar

arpwatch (选项)

Options

  • -d: Start debugging mode;
  • -f<记录文件>: Set the file to store ARP records, the default is /var/arpwatch/arp.dat;
  • -i<接口>: Specify the interface to monitor ARP, the default interface is eth0;
  • -r<记录文件>: Read ARP records from the specified file instead of listening from the network.

telnet

Log in to the remote host and management (test whether the IP port is connected)

Additional information

telnetThe command is used to log in to the remote host and manage the remote host. Because telnet uses clear text to transmit messages, its security is not good. Many Linux servers do not open the telnet service and use the more secure ssh method instead. But there are still many other systems that may use telnet to provide remote login, so it is still necessary to figure out how to use the telnet client.

grammar

telnet (选项) (参数)

Options

  • -8: Allows the use of 8-bit character data, including input and output;
  • -a:Try to automatically log in to the remote system;
  • -b<主机别名>: Use an alias to specify the remote host name;
  • -c: Do not read the .telnetrc file in the user-specific directory;
  • -d: Start debugging mode;
  • -e<脱离字符>:Set the escape character;
  • -E: Filter out escaped characters;
  • -f: The effect of this parameter is the same as specifying the "-F" parameter;
  • -F: When using Kerberos V5 authentication, adding this parameter can upload the authentication data of the local host to the remote host;
  • -k<域名>: When using Kerberos authentication, add this parameter to let the remote host use the specified domain name instead of the domain name of the host;
  • -K:Do not automatically log in to the remote host;
  • -l<用户名称>: Specify the user name to log in to the remote host;
  • -L: Allows output of 8-bit character data;
  • -n<记录文件>: Specify files to record relevant information;
  • -r:Use a user interface similar to the rlogin command;
  • -S<服务类型>: Set the ip TOS information required for telnet connection;
  • -x: Assuming that the host has the function to support data encryption, use it;
  • -X<认证形态>: Close the specified authentication mode.

parameter

  • 远程主机: Specify the remote host to log in for management;
  • 端口: Specify the port number used by the TELNET protocol.

Example

$ telnet 192.168.2.10
Trying 192.168.2.10...
Connected to 192.168.2.10 (192.168.2.10).
Escape character is '^]'.

    localhost (Linux release 2.6.18-274.18.1.el5 #1 SMP Thu Feb 9 12:45:44 EST 2012) (1)

login: root
Password:
Login incorrect

Under normal circumstances, root is not allowed to log in remotely. You can log in with a normal account first, and then use su - to switch to the root user.

$ telnet 192.168.188.132
Trying 192.168.188.132...
telnet: connect to address 192.168.188.132: Connection refused
telnet: Unable to connect to remote host

Ways to handle this situation:

  • Confirm that the IP address is correct?
  • Check whether the host corresponding to the IP address is powered on?
  • If the host has started, confirm that the routing settings are set correctly? (Use the route command to view)
  • If the host has been started, confirm whether the telnet service is enabled on the host? (Use the netstat command to check whether there is a line with LISTEN status on TCP port 23)
  • If the host has started the telnet service, confirm whether the firewall has allowed access to port 23? (View using iptables-save)

Start the telnet service:

service xinetd restart

Configuration parameters, the usual configuration is as follows:

service telnet
{
    
    
    disable = no #启用
    flags = REUSE #socket可重用
    socket_type = stream #连接方式为TCP
    wait = no #为每个请求启动一个进程
    user = root #启动服务的用户为root
    server = /usr/sbin/in.telnetd #要激活的进程
    log_on_failure += USERID #登录失败时记录登录用户名
}

If you want to configure the list of clients allowed to log in, add:

only_from = 192.168.0.2 #只允许192.168.0.2登录

If you want to configure a list of clients that are prohibited from logging in, add:

no_access = 192.168.0.{
    
    2,3,4} #禁止192.168.0.2、192.168.0.3、192.168.0.4登录

If you want to set the opening period, add:

access_times = 9:00-12:00 13:00-17:00 # 每天只有这两个时段开放服务(我们的上班时间:P)

If you have two IP addresses, one is a private network IP address such as 192.168.0.2, and the other is a public network IP address such as 218.75.74.83. If you want users to log in to the telnet service only from the private network, then add:

bind = 192.168.0.2

For the specific meaning and syntax of each configuration item, please refer to the xined configuration file attribute description (man xinetd.conf)

Configure the port and modify the services file:

# vi /etc/services

Find the following two sentences:

telnet 23/tcp
telnet 23/udp

If there is a # character in front of it, remove it. The default port of telnet is 23. This port is also the main target of hacker port scanning, so it is best to modify this port. The modification method is very simple, which is to modify the number 23 to a larger number, such as 61123. Note that port numbers below 1024 are reserved by the Internet, so it is best not to use them. You should also be careful not to conflict with the ports of other services.

Start the service:

service xinetd restart

Learn from scratchpython

[Learn python from scratch] 92. Use Python’s requests library to send HTTP requests and process responses
[Learn python from scratch] 91. Use decorators and dictionaries to manage request paths in a simple web application
[Learn python from scratch] 93. Use dictionary management Request path
[Learn python from scratch] 89. Use WSGI to build a simple and efficient Web server
[Learn python from scratch] 88. Detailed explanation of WSGI interface: realize simple and efficient web development
[Learn python from scratch] 87. Manually build an HTTP server in Python Implementation and multi-threaded concurrent processing
[Learn python from scratch] 86. In-depth understanding of the HTTP protocol and its role in browser and server communication
[Learn python from scratch] 85. Application of parallel computing technology in Python process pool
[Learn python from scratch] ] 84. In-depth understanding of threads and processes
[Learn python from scratch] 83. Python multi-process programming and the use of process pools
[Learn python from scratch] 82. Chat program implementation based on multi-threading
[Learn python from scratch] 81. Python more Application of thread communication and queue
[Learn python from scratch] 80. Thread access to global variables and thread safety issues
[Learn python from scratch] 79. Thread access to global variables and thread safety issues
[Learn python from scratch] 78. File download case
[ Learn python from scratch] 77. TCP server programming and precautions
[learn python from scratch] 76. Server and client: key components of network communication
[learn python from scratch] 75. TCP protocol: reliable connection-oriented transmission layer communication protocol
[Learn python from scratch] 74. UDP network program: Detailed explanation of port issues and binding information
[Learn python from scratch] 73. UDP network program - sending data
[Learn python from scratch] 72. In-depth understanding of Socket communication and creation of sockets Method
[Learn python from scratch] 71. Network ports and their functions
[Learn python from scratch] 70. Network communication methods and their applications: from direct communication to routers to connect multiple networks
[Learn python from scratch] 69. Network communication and IP address classification analysis
[Learn python from scratch] 68. Greedy and non-greedy modes in Python regular expressions
[Learn python from scratch] 67. The re module in Python: regular replacement and advanced matching technology
[Learn python from scratch] 66 .In-depth understanding of regular expressions: a powerful tool for pattern matching and text processing
[Learn python from scratch] 65. Detailed explanation of Python regular expression modifiers and their applications
[Learn python from scratch] 64. The re.compile method in Python regular expressions Detailed explanation of usage
[Learn python from scratch] 63. Introduction to the re.Match class and its attributes and methods in regular expressions
[Learn python from scratch] 62. Python regular expressions: a powerful string matching tool
[Learn python from scratch] 61. Detailed explanation and application examples of property attributes in Python
[Learn python from scratch] 60. Exploration generator: a flexible tool for iteration
[Learn python from scratch] 59. Iterator: An efficient tool for optimizing data traversal
[Learn python from scratch] 58. Custom exceptions in Python and methods of raising exceptions
[Learn python from scratch] 57. Use the with keyword in Python to correctly close resources
[Learn python from scratch] 56. The importance and application of exception handling in programming
[Learn python from scratch] 55. Serialization and sum in Python Deserialization, application of JSON and pickle modules
[Learn python from scratch] 54. Writing data in memory
[Learn python from scratch] 53. CSV files and Python’s CSV module
[Learn python from scratch] 52. Reading and writing files - Python file operation guide
[Learn python from scratch] 51. Opening and closing files and their applications in Python
[Learn python from scratch] 49. Object-related built-in functions in Python and their usage
[Learn python from scratch] 48 .Detailed explanation of inheritance and multiple inheritance in Python
[Learn python from scratch] 47. The concept and basic use of inheritance in object-oriented programming
[Learn python from scratch] 46. Analysis of __new__ and __init__ methods and singletons in Python Design Patterns
[Learn python from scratch] 45. Class methods and static methods in Python
[Learn python from scratch] 44. Private properties and methods in object-oriented programming
[Learn python from scratch] 43. Examples in Python object-oriented programming Properties and class attributes
[Learn python from scratch] 42. Built-in properties and methods in Python
[Learn python from scratch] 41. python magic method (2)
[Learn python from scratch] 40. python magic method (1)
[Learn python from scratch] 39. Basic object-oriented syntax and application examples
[Learn python from scratch] 38. How to use and import Python packages
[Learn python from scratch] 37. The use and precautions of Python custom modules
[Learn python from scratch] Learn python] 36. Methods and techniques of using pip for third-party package management in Python
[Learn python from scratch] 35. Python common system modules and their usage
[Learn python from scratch] 34. Detailed explanation of the import and use of Python modules
[ Learn python from scratch] 33. The role of decorators (2)
[Learn python from scratch] 32. The role of decorators (1)
[Learn python from scratch] 31. In-depth understanding of higher-order functions and closures in Python
[From Learn python from scratch】30. In-depth understanding of recursive functions and anonymous functions
【learn python from scratch】29. "Detailed explanation of function parameters" - understand the different uses of Python function parameters
【learn python from scratch】28. Local variables and global variables in Python Variables
[Learn python from scratch] 27. The use of Python functions and nested calls
[Learn python from scratch] 25. Functions: a tool to improve the efficiency of code writing
[Learn python from scratch] 24. String operations and traversal methods in Python
[Learn python from scratch] 23. How to use sets (set) and common operations in Python
[Learn python from scratch] 22. Add, delete, modify, and query dictionary variables in Python
[Learn python from scratch] 21. Python tuples and dictionaries
[Learn python from scratch] 20. Python list operation skills and examples
[Learn python from scratch] 19. Applications of looping through lists and list nesting
[Learn python from scratch] 18. Detailed explanation of the basic operations of Python lists (1)
[From Learning python from scratch】 17. The format method of Python strings (2)
【Learning python from scratch】 16. The format method of Python strings (1)
【Learning python from scratch】 15. In-depth understanding of strings and character set encoding
【From Learning python from scratch】14. Common operations on Python strings (2)
【Learning python from scratch】13. Common operations on Python strings (1)
【Learning python from scratch】12. Python string operations and applications
【Learning python from scratch】 11. Python loop statements and control flow
[Learn python from scratch] 10. Detailed explanation of Python conditional statements and if nesting
[Learn python from scratch] 09. Conditional judgment statements in Python
[Learn python from scratch] 08. Python understands bit operations operator, operator priority
[Learn python from scratch] 07. Detailed explanation of Python operators: assignment, comparison and logical operators
[Learn python from scratch] 06. Use arithmetic operators in Python for calculations and string concatenation
[Learn from scratch] python ] 05. Output and input in Python
[Learn python from scratch] 04. Basics of Python programming: variables, data types and identifiers
[Learn python from scratch] 03. Python interactive programming and detailed explanation of comments
[Learn python from scratch] 02. Introduction to development tools
[Learn python from scratch] 01. Install and configure python

Guess you like

Origin blog.csdn.net/qq_33681891/article/details/132895770