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 operate the server remotely without installing Xshell and Xftp

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to remotely operate the server without installing Xshell and Xftp, I believe most people don't know much about it, so share this article for your reference. I hope you can learn a lot after reading this article. Let's learn about it together.

Preface

As mentioned before, I now work in a state-owned enterprise. Because the network environment of the group is a closed intranet, the usual deployment is online, and log checking is done through a springboard fortress machine to connect to the intranet machine, as shown in the following figure:

And think of Alibaba's open source Java diagnostic tool Arthas, whose Web Console can execute commands on the browser, which is easy to operate and has a very nice interface.

Then I want to implement a Web SSH of my own and explore its internal principles.

Realize

Webssh generally refers to a technology that can implement a SSH terminal on a web page. As a result, there is no need for analog terminal tools such as Xshell to connect to SSH, and the relatively low-level operation of SSH is also twisted from the Cpicurus S architecture to the Bamp S architecture.

working principle

+-+ http +-+ ssh +-+ | browser | | webssh | | ssh server | +-+ websocket +-+ ssh +-+

WebSocket persistent connection for real-time interaction between instruction sending and response

Xterm.js is a WebSocket-based container that helps us implement command-line styles at the front end.

JSch is a pure Java implementation of SSH2. It allows you to connect to a sshd server, using port forwarding, X11 forwarding, file transfer, and so on.

Realize the function

Command execution

File upload / download

Related code

Dependence

Org.springframework.boot spring-boot-starter-parent 2.3.7.RELEASE org.springframework.boot spring-boot-starter-web com.jcraft jsch 0.1.54 org.springframework.boot spring-boot-starter-websocket

Relevant screenshot

Log in

Command execution

File list, delete, download

File upload

Because the related implementation is relatively simple, you only need to take a look at JSch and xterm.js, and you are free to expand the related functions.

The above is all the contents of the article "how to operate the server remotely without installing Xshell and Xftp". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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