Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Python makes simple SSH login tools


Jun 01, 2021 Article blog



This article was reproduced to Know ID: Charles (Bai Lu) knows his personal column

Download the W3Cschool Mobile App, 0 Foundation Anytime, Anywhere Learning Programming >> Poke this to learn

Lead

The cause of this is probably:

Xshell on the computer doesn't know why it suddenly shows a prompt like "the evaluation period has passed"...

Remember that the previous certification of the school mailbox is free to use...

Who does the heavens bypass...

Think of the last certified school mailbox took N hours to receive that certified email...

I decided...

Do it yourself, eat and clothe...

Anyway, there's no more public number for days... Just a wave of water...

Just have a try!


Related documents

Baidu web download link: https://pan.baidu.com/s/1-GK9-zdbvanTEXphSN2SmQ

Password: djdj


Develop tools

Python version: 3.5.4

Related modules:

Paramiko modules as well as some Python-owned modules.

operating system:

Windows series.

Environment construction

Install Python and add it to the environment variable, and pip installs the relevant modules that are required.

The main idea

objective:

Make a command-line version of the SSH login tool.

Features to implement:

(1) Add/remove the IP, port and password required to connect to the server;

(2) Automatically enter the password to log on to the remote server.

See the source code for details.

PS:

In line with the principle of using Python to try not to manufacture wheels, SSH logins are mainly based on the paramiko module.


Use the demo

Let's put on a video...

I'm too lazy to take a screenshot...


more

This code applies only to Windows systems.

Interested parties can modify the source code to make the Mac/Linux version on their own.

If there are any optimization comments during use:

Welcome backstage communication!

The script will be further optimized and extended in the future if there is time.