Cygwin openssh for Windows

Source: Internet
Author: User

Cygwin + OpenSSH for Windowsthe installation configuration

Cygwin is a world-famous software, it can be Linux under the free software to the Windows system to apply, understand and master the software, will give you a lot of useful choices, and take you to a broader sky, which will be a definite impetus for your study and work. Here I use a summary of my own example, to bring everyone into the world.

First, Cygwin installation method

Click Install as

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/89/C8/wKiom1gcM4zCxN_NAAHOz8uEp2Y789.png "title=" 1.png " alt= "Wkiom1gcm4zcxn_naahoz8uep2y789.png"/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/89/C6/wKioL1gcM6TCsKhzAADh3oTLn5Q927.png "style=" float: none; "title=" 2.png "alt=" Wkiol1gcm6tcskhzaadh3otln5q927.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/89/C8/wKiom1gcM6SgOqOrAAA6WFUl1aw139.png "style=" float: none; "title=" 3.png "alt=" Wkiom1gcm6sgoqoraaa6wful1aw139.png "/>


Default Next

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/89/C8/wKiom1gcM8HBHQ2hAAAtxzwgq_0857.png "style=" float: none; "title=" 4.png "alt=" Wkiom1gcm8hbhq2haaatxzwgq_0857.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/89/C6/wKioL1gcM8LR7eDpAAAtylZl9aE237.png "style=" float: none; "title=" 5.png "alt=" Wkiol1gcm8lr7edpaaatylzl9ae237.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/89/C6/wKioL1gcM8LTFjTNAAAnIn3ReRA780.png "style=" float: none; "title=" 6.png "alt=" Wkiol1gcm8ltfjtnaaanin3rera780.png "/>


in the user URL input Http://mirrors.163.com/cygwin Click Add

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/89/C8/wKiom1gcM9vCIYd_AAA-rPIPJZs608.png "style=" float: none; "title=" 7.png "alt=" Wkiom1gcm9vciyd_aaa-rpipjzs608.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/89/C6/wKioL1gcM9uzz2oSAAApCTMVgek494.png "style=" float: none; "title=" 8.png "alt=" Wkiol1gcm9uzz2osaaapctmvgek494.png "/>



Query ssh, select the tick mark in net default (this operation will install SSH and SSL)

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/89/C8/wKiom1gcM-7gghY5AACkVWsMgcY224.png "title=" 9.png " alt= "Wkiom1gcm-7gghy5aackvwsmgcy224.png"/>

Installing the VIM Plugin

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/89/C6/wKioL1gcNAfwAnymAAB5I2nolqA808.png "style=" float: none; "title=" 10.png "alt=" Wkiol1gcnafwanymaab5i2nolqa808.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/89/C8/wKiom1gcNAiyaWdEAAAsL0WghD4928.png "style=" float: none; "title=" 11.png "alt=" Wkiom1gcnaiyawdeaaasl0wghd4928.png "/>

Second, the installation of SSHD services

Click Cygwin Desktop Shortcut

Output Ssh-host-config–y After the session that appears

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/89/C8/wKiom1gcNCeDUc03AAGEHzdu5UM331.png "title=" 12.png "alt=" Wkiom1gcnceduc03aagehzdu5um331.png "/>

This command installs the SSHD service and generates two accounts in between Sshd and Cyg_server

Where Cyg_server need to set a password

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/89/C6/wKioL1gcNDqzUHfkAAGoZ0O0S_Q157.png "style=" float: none; "title=" 13.png "alt=" Wkiol1gcndqzuhfkaagoz0o0s_q157.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/89/C6/wKioL1gcNDvxZ7PLAAAsmk8VwzQ897.png "style=" float: none; "title=" 14.png "alt=" Wkiol1gcndvxz7plaaasmk8vwzq897.png "/>

Take a look at the bottom line, stating that the installation service is successful!

Start the service net start sshd

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/89/C6/wKioL1gcNE2it35wAAAM-eIqyfk780.png "title=" 15.png "alt=" Wkiol1gcne2it35waaam-eiqyfk780.png "/>

There should be garbled encoding problems. Does not affect the operation. You can also see whether the service starts properly in the list of services.

Third, add firewall rules

Adds an inbound rule to the firewall, allowing port 22 inbound.

Remark: 1, Cygwin can realize SSH mutual trust

2 , you can script the implementation of the site bulk operations.

The script is as follows (this script serves as a way of thinking)

#!/bash/sh# Time:2016-07-12cd /cygdrive/c/windows/system32/inetsrv echo  "************************* "echo " *                                           * "echo " *         iis Management Program Scripts                    * "echo " *                                           * "  echo " ******************* " echo " *       1) Recycle program application pool                    * "          echo  "*       2" Restart the site service                      * "           echo  "*       3" Restart Server service                   * "  echo  "*******************************************"  HostIP=192.168.1read -p  " Please choose what you want to do: " arg        case  $arg  in1) read -p  "Please enter the Web server you want to manipulate (such as 192.168.1.87 just enter 87.) Each IP is separated by a space): " WebIPif [[  $WebIP  =~ ^[0-9][0-9"   "]+$ ]];then    for ip in  $WebIP    do   echo  web host ip:  $HOstip. $ip "   ssh [email protected" $HostIP. $ip   "cd /cygdrive/c/windows/ System32/inetsrv ; ./appcmd.exe list app "   done   read  -p  "Please enter the Recycle program application pool name:"  zendao;   for ip in  $WebIP    do    echo  "web host ip:  $HostIP. $ip"    ssh [email protected]$ HostIP. $ip   "cd /cygdrive/c/windows/system32/inetsrv ; ./appcmd.exe recycle  Apppool \ "$zendao \" "   done   else echo " you entered the wrong IP, Please re-export. Format: Each IP is separated by a space and cannot exist characters or other characters "FI;; 2)              read -p  " Please enter the Web server you want to operate on (such as 192.168.1.87 just enter 87. Each IP is separated by a space): " WebIPif [[  $WebIP  =~ ^[0-9][0-9"   "]+$ ]];then    for ip in  $WebIP    do   echo  web host ip: $HostIP. $ip "   ssh [email protected" $HostIP. $ip   "cd /cygdrive/c/windows/ System32/inetsrv ; ./appcmd.exe list site "   done   read  -p  "Please enter the name of the site you want to restart:"  zendao;   for ip in  $WebIP     do   echo  "web host ip:  $HostIP. $ip"    ssh [email protected]$ HostIP. $ip   "Cd /cygdrive/c/windows/system32/inetsrv ; ./appcmd.exe stop site  /site.name:\ "$zendao \" "   ssh [email protected" $HostIP. $ip   "cd / Cygdrive/c/windows/system32/inetsrv ; ./appcmd.exe start site /site.name:\ "$zendao \" "    done   else echo  "You entered the wrong IP, please re-export." Format: Each IP is separated by a space and cannot exist characters or other characters "FI;;                3)          echo&nBSP; " Zabbix Client Service: zabbix agent "read -p " Enter the Web server you want to operate (for example, 192.168.1.87 just enter 87.) Each IP is separated by a space): " WebIPread -p " Please enter the name of the service that needs to be restarted: " zendao;if [[  $WebIP  =~ ^[0-9 ][0-9 " "]+$ ]];then   for ip in  $WebIP    do    echo  "web host ip:  $HostIP. $ip"    ssh [email protected "$HostIP. $ip  " Net stop \ "$zendao \"  ; net start \ "$zendao \" "   done fi  ;;?)  echo -e  "You entered the wrong option, please re-enter the correct option!" "exit 0;;                esac

This article is from the "Tranquility Zhiyuan" blog, please be sure to keep this source http://irow10.blog.51cto.com/2425361/1869471

Cygwin openssh for Windows

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.