In linux, scp is used for remote file transfer, and reverse CT technology is used to support automatic password input.

Source: Internet
Author: User
In linux, scp is used for remote file transfer, and the reverse CT technology is used. The password can be automatically entered. 1. edit copycgi. sh. the main user filters the files to be transferred. the content is as follows :#! /Bin/bashpath & quot;./& quot; if [$ #-eq1]; thenpath $ 1if [! -D $ path]... in linux, scp is used for remote file transfer and reverse CT technology. The password can be automatically entered. edit copycgi. sh. the main user filters the files to be transferred. the content is as follows :#! /Bin/bashpath = "./" if [$ #-eq 1]; then path = $1 if [! -D $ path]; then echo "please input valid dir. "exit fifi ls-al $ {path }/*. cgi | while read linedofilename = 'echo $ line | awk '{print $8 }''#! Echo "start send" $ filename. /expect_scp_one.sh $ filenameecho "send $ {filename} finish" done 2. edit the expect_scp_one.sh file, which is used to transfer a specified file to the specified machine. the content is as follows #! /Usr/bin/keep CT-f set passwd logviewset src_path [lindex $ argv 0] set dst_path "logview@172.25.38.13: /usr/local/www.AAA.com/app/mpay/ "spawn scp-Q-p $ src_path $ dst_path set timeout 30 # CT-re ". * assword: \ r "send" $ passwd \ r "set timeout 30 send" exit \ r "wrong CT eof 3. grant the executable attributes chmod + x expect_scp_one.sh chmod + x copycgi. sh 4. test. /copycgi. sh. /spawn scp-Q-p. /mp_credit_userinfo.cgi logview@172.25.38.13:/usr/local/www.AAA.com/app/mpay/logviewexitlogview@172.25.38.13's password: encrypted Ed signal 1. (no core) send. /mp_credit_userinfo.cgi finish
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.