What Can I Do If the SSH Tunnel Process Is Abnormal?
In the hybrid cloud scenario, the Secure Shell (SSH) tunnel process becomes abnormal when monitoring data is forwarded to APM through a jump server. To solve the problem, do as follows:
- Log in to the jump server using a remote login tool.
- Run the following command to configure interaction-free login:
ssh-keygen cd /root/.ssh/ cat id_rsa.pub > authorized_keys vi /etc/ssh/sshd_config
Set the value of PubkeyAuthentication to yes.service sshd restart
- Obtain the checkSsh.sh script, modify the configuration, and set the permission.
- Obtain the script.
Download address: https://icagent-{region}.obs.{region}.myhuaweicloud.com/ICAgent_linux/checkSsh.sh
The download address varies according to region. Replace {region} in the download address with the actual region.
- Set the permission.
chmod +x checkSsh.sh
- Execute the checkSsh.sh script.
- In the following commands, replace {Jump server IP address}, {ELB IP address}, and {region} with the actual values.
- If the jump server runs Ubuntu or Debian, run the sudo dpkg-reconfigure dash command and select NO before running the checkSsh.sh script.
sh checkSsh.sh "ssh -f -N -L {Jump server IP address}:8149:{ELB IP address}:8149 -L {Jump server IP address}:8102:{ELB IP address}:8102 -L {Jump server IP address}:8923:{ELB IP address}:8923 -L {Jump server IP address}:30200:{ELB IP address}:30200 -L {Jump server IP address}:30201:{ELB IP address}:30201 -L {Jump server IP address}:80:icagent-{region}.obs.{region}.myhuaweicloud.com:80 {Jump server IP address}"
- Obtain the script.
- Configure the crontab command and run it periodically.
crontab -e */10 * * * * /home/tools/checkSsh.sh ssh -f -N -L {Jump server IP address}:8149:{ELB IP address}:8149 -L {Jump server IP address}:8102:{ELB IP address}:8102 -L {Jump server IP address}:8923:{ELB IP address}:8923 -L {Jump server IP address}:30200:{ELB IP address}:30200 -L {Jump server IP address}:30201:{ELB IP address}:30201 -L {Jump server IP address}:80:icagent-{region}.obs.{region}.myhuaweicloud.com:80 {Jump server IP address} crond restart
- In the preceding command, the /home/tools/checkSsh.sh directory is used as an example. Replace it with an actual directory.
- 10 indicates that the command is run every 10 minutes. You can change the value as required.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot