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 ssh tools to facilitate remote management

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

Share

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

How to use ssh tools to facilitate remote management, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Use ssh services to remotely manage hosts.

First of all, before using the ssh service tool, we should be familiar with the startup principle of the Linux operating system: the boot process of the Linux operating system starts from BIOS and → enters the initialization → startup initialization process of "Boot Loader" → to load the kernel → kernel. As the first process of the system, the initialization process needs to complete the relevant initialization work to provide users with a suitable working environment.

My test environment was a Red Hat RHEL7 system, replacing the previously familiar daemon with systemd and replacing many administrative commands with the sytemctl command.

Configure the network card to connect to the network

Before introducing the configuration of the network card, we first introduce the three network modes of the VM virtual machine:

Bridged (bridging is most suitable for production environment)

In this way, the virtual machine, like a real computer, is directly connected to the actual network and has no connection with the host.

NAT (NAT mode is suitable for family environment)

In this way, the network card of the virtual machine is connected to the Vmnet 8 of the host. At this time, the VMware NAT Service service of the system acts as a router, which is responsible for sending the packet sent to VMnet8 by the virtual machine to the actual network after address translation, and then sending the packet returned on the actual network to the virtual machine through VMnet8 after address translation. VMware DHCP Service is responsible for providing DHCP services to virtual machines.

Host-Only (Host-only can not surf the Internet)

In this way, the network card of the virtual machine is connected to the Vmnet 1 of the host, but the system does not provide any routing services for the virtual machine, so the virtual machine can only communicate with the host, but not connect to the actual network.

After you are familiar with the three network modes, let's describe how to configure the Nic information:

1. Configure network card parameters

This lab requires two virtual hosts, namely:

Local host: 172.168.66.66

Remote host: 172.168.66.67

Step 1: execute the command "nmtui".

[root@test Desktop] # nmtui

Step 2: select the network card to edit.

Step 3: edit the network card information.

Step 4: set the IPv4 configuration item of the network card to manual.

Step 5: click (Show) to the right of the Ipv4 configuration item and fill in the IP address information.

Step 6: click the bottom (OK), confirm that the information is filled in correctly and exit.

Step 7: run the network card configuration program again and choose to activate the network card.

Step 8: activate this network card successfully.

Step 9: modify the network card configuration file setting "ONBOOT=yes".

ONBOOT indicates whether the network card is activated when the system is started. Only the network card in the active state can connect to the network and communicate with the network.

Input: vi / etc/sysconfig/network-scripts/ifcfg-eth0

After entering the modify menu, press I to enter insert mode:

>

Delete the line HWADDR= (click dd to delete the whole line)

Delete the line UUID=.

Press the ESC key to save exit (: wq! ). Do not save exit:: Q!

Step 10: restart the Nic command (two):

/ etc/init.d/network restart (this is better, it can be completed by tab)

Server network restart

After you have configured the network card by following the steps above, execute "ping 172.168.66.67" on the local host to check whether the network has been configured properly.

Use the following command to view information about the network card

View the configuration information of the Nic:

[root@test ~] # nmcli connection show

Check the connection status of the network card:

[root@test ~] # nmcli device status

Configure SecureCRT to connect to the Linux host

Remote connection windows: remote Desktop (port 3389), KVM, VNC, PCanywhere

Server Linux remote connection tools (SSH service): putty, SecureCRT, xshell

SSH's full name is Secure Shell.

After we open the SecureCRT program, as shown in the following figure:

Third, there are three reasons why the Linux host cannot be connected, which can be checked one by one.

1. Iptables firewall of server Linux host

Command:

/ etc/init.d/iptables stop

Chkconfig iptables off

2. SSH service (not started or port 22 has been modified)

Telnet linux_ip 22

3. Line problem (ping Linux host ip address)

IV. Adjust terminals and buffers

Open the session option-Terminal-Emulation-select the terminal in the right dialog box: Linux, check the ANSI color, and the rollback buffer size is 32000.

5. Adjust font and cursor color

Conversation option-appearance-check the missing font in the right side of the dialog box (usually 16), and check the color (fresh green is recommended).

6. Configure and record SSH operation log and output

Session options-Log File-set the path in the dialog box on the right, check start record on connection, and check append to file.

The main purpose of this configuration is to define the naming rules and paths for log file names.

Special reminder: this setting must be exited and reconnected to take effect.

Exit: shortcut key ctrl+D/exit/quit

7. Configure the upload and download directory of the local machine

Session options-choose the upload and download paths in the Xmodem/Zmodem- right-facing dialog box.

This item is mostly used in ftp, sftp (wincp) and other tools to facilitate operations in the process of operation and maintenance.

8. Multi-window batch execution command configuration at the same time

After opening the SecureCRT software tool, check the menu bar viewing options and check "chat window", then a blank box appears below. Right-click in the blank box to select "send conversation to all tags", as shown below:

Tip:

You can take advantage of this small feature when there are dozens of batch deployments or tasks.

If it is a large-scale server, it does not apply.

After reading the above, have you mastered how to use ssh tools to facilitate remote management? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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