Sssh-fast ssh login script

Source: Internet
Author: User
Article Title: sssh-fast ssh login script. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

This script should be useful to those who need to frequently log on to the remote server through ssh. In particular, it is necessary to transfer the server ssh for more than two times. Script functions include saving the Server IP address and password in a text file (plaintext storage, security must be ensured by yourself), facilitating login, supporting multiple ssh transfers, and automatic conversion of server encoding, supports a common password for a user name.

Usage:

It is best to save the script to the path included in the path variable. We recommend that you save it ~ /Bin and make sure that the directory is in PATH.

Write ~ /. Pass file and run chmod 600 ~ /. Pass

Install the keep CT package.

. Pass File Syntax:

The simplest is to write the following line in the file:
Name = hostA usernameA @ IP-A passwordA

You can use sssh hostA to log on to this server.

Transit login:

Name = hostA usernameA @ IP-A passwordA
Name-hostA = hostB usernameB @ IP-B passwordB

 

Execute sssh hostA hostB to log on to hostA first, and then log on to hostB on hostA. Likewise, in theory, you can transfer data N times, hostA-> hostB-> hostC-> hostD ......, Hey hey ......

Password with a Common User Name:
This is an example: there are N servers, all of which have a common user name (for example, view users, with only low permissions), and the passwords of these view users are the same, it also regularly synchronizes modifications. In this case, if you change the view password, you need to change N passwords in the. pass file. To avoid this problem, you can use the common user name and password function:

UsualName view
UsualPSW password-of-view
Name = hostA view @ IP-A
Name = hostB view @ IP-B
Name = hostC view @ IP-C


In this way, you can directly log on to sssh hostA and sssh hostB. We can see that the password field in column 3rd is omitted here. This method is also applicable to multi-level login servers.

Specify the encoding used by the server:

UsualName view
UsualPSW password-of-view
Name = hostA usernameA @ IP-A passwordA gbk
Name = hostB view @ IP-B | gbk

 

Add gbk to the back of a row of server (column 4th) to indicate that the server uses gbk. No garbled characters will appear after login. If a row uses a common user name and password, add a | (vertical line) placeholder to the password column to avoid confusion.

Use common encoding:
UsualCODING gbk

When this line is added, gbk encoding is used by default for servers with no encoding specified.

Download:

Because the script is pasted here, the quotation marks become full. Therefore, download it directly here. Linuxfire.com.cn /~ Lily/sssh "> http://linuxfire.com.cn /~ Lily/sssh

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.