SSH Virtual Terminal application Example

Source: Internet
Author: User

Objective:

I encountered several instances of SSH execution failure during the scripting process, all resolved with the-t option. Now write it and share it with you.

Scenario 1

Scripting requires local delivery of positional variables for use by remote servers, but the parameters are always passed, and then successfully delivered after the-t option is added behind

(1) Original script

Ssh-p 1024x768 122.224.xxx.xxx "cd/streams/&& md5sum $2* >>/hzdata/filelist/$1.lst && Exit"

(2) Current script

SSH-T-P 1024x768 122.224.xxx.xxx "cd/streams/&& md5sum $2* >>/hzdata/filelist/$1.lst && Exit"

Scenario 2

Because the key authentication between the two servers, the key verification is done, but because the host information changed, in the know_hosts file needs to be re-recorded, because there are too many servers, so you need to do a script, only need to execute SSH-P IP, but the original script execution will be error, as follows, the plus-t option is normal. The script means to execute the script in a server, log on to the B server, then ssh-p the IP, record a server host information, manually perform exit B server, and then &&exit exit to a server, update know_hosts file completion. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/83/50/wKioL1dwp-CRzjX_AAAO5JHUQs0318.png "title=" Sogou 20160627121252.png "alt=" Wkiol1dwp-crzjx_aaao5jhuqs0318.png "/>

(1) Original script

Ssh-p 1024x768 $i "ssh-p 1.202.197.87 && Exit"

(2) Current script

SSH-T-P 1024x768 $i "ssh-p 1024x768 1.202.197.87 && Exit"

This article is from the "Court of the Odd Tree" blog, please be sure to keep this source http://zhangdl.blog.51cto.com/11050780/1793226

SSH Virtual Terminal application Example

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.