windows下安裝cygwin+openssh

來源:互聯網
上載者:User

 

1. 
安裝好JDK,我的是安裝在D盤下,具體為:D:/Java/jdk1.6.0_20

2. 
線上安裝cygwin,安裝過程中選擇的鏡像是 http://www.cygwin.cn/pub/ ,安裝過程中要選上net包下的關於openssh和openssl的選項

我的安裝目錄為D:/cygwin

3. 
安裝好後,在我的電腦環境變數中,

設定JAVA_HOME為D:/Java/jre6,

並將D:/Java/jdk1.6.0_20/bin;D:/cygwin/bin;D:/cygwin/usr/sbin添加到PATH中。

4. 
開啟cygwin命令列

5.  輸入命令:ssh-host-config

接下來要回答一些問題才能繼續

1)
When asked if privilege
separation should be used, answer no.

2)
When asked if sshd should be
installed as a service, answer yes.

3) When
asked about the value of CYGWIN environment variable enter ntsec.

4)
如下:


 

6. 
啟動cygwin sshd 服務,在cygwin命令列下輸入:net
start sshd。

7. 
配置ssh登陸

1)
輸入:ssh-keygen,接下來的詢問直接取預設值,即直接斷行符號即可。

2) 輸入:cd ~/.ssh

3)
輸入:ls –l,將會看到 id_rsa.pub  id_rsa 兩個檔案

4) 輸入:cat id_rsa.pub >>
authorized_keys。

5) 輸入:ssh localhost,第一次的時候會被詢問是否繼續串連,輸入:yes即可。再次輸入:ssh localhost,會發現之前的詢問沒了。

6) 輸入:who,會得到類似結果,否則過程可能已經出錯。

 

7) 過程

 

8) 輸入:exit,即退出ssh登陸,

 

8. 
輸入:net stop sshd,關閉cygwin ssdh服務,

 

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.