[20201120]cygwin與ssh.txt
[20201120]cygwin與ssh.txt
--//昨天安裝cygwin後,今天安裝openssh,發現cygwin的ssh無法連線測試伺服器,提示:
$ ssh -l root 192.168.100.78
Unable to negotiate with 192.168.100.78 port 22: no matching key exchange method found. Their offer:
diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
--//上網看一個一些連結:
$ cd ~
$ mkdir .ssh
$ cd .ssh
$ touch config
$ chmod 660 config
$ cat config
Host *
KexAlgorithms +diffie-hellman-group1-sha1
--//這樣就可以ok了。
--//我使用strace跟蹤發現:
$ strace ssh -l root 192.168.100.78 | grep "/etc/"
15 3207 [main] ssh (6576) mount_info::conv_to_posix_path: /etc/ssh = conv_to_posix_path (D:\tools\cygwin64\etc\ssh)
20 5562 [main] ssh 2018 win32env_to_cygenv: 0x8000290F0: PWD=/etc/ssh
91 86350 [main] ssh 2018 open: open(/etc/ssh_config, 0x0)
12 86362 [main] ssh 2018 normalize_posix_path: src /etc/ssh_config
13 86375 [main] ssh 2018 normalize_posix_path: /etc/ssh_config = normalize_posix_path (/etc/ssh_config)
14 86389 [main] ssh 2018 mount_info::conv_to_win32_path: conv_to_win32_path (/etc/ssh_config)
13 86402 [main] ssh 2018 mount_info::conv_to_win32_path: src_path /etc/ssh_config, dst D:\tools\cygwin64\etc\ssh_config, flags 0x30008, rc 0
12 86850 [main] ssh 2018 open: -1 = open(/etc/ssh_config, 0x8000), errno 2
104 138357 [main] ssh 2018 open: open(/etc/ssh_known_hosts, 0x0)
13 138370 [main] ssh 2018 normalize_posix_path: src /etc/ssh_known_hosts
13 138383 [main] ssh 2018 normalize_posix_path: /etc/ssh_known_hosts = normalize_posix_path (/etc/ssh_known_hosts)
16 138399 [main] ssh 2018 mount_info::conv_to_win32_path: conv_to_win32_path (/etc/ssh_known_hosts)
15 138414 [main] ssh 2018 mount_info::conv_to_win32_path: src_path /etc/ssh_known_hosts, dst D:\tools\cygwin64\etc\ssh_known_hosts, flags 0x30008, rc 0
17 138943 [main] ssh 2018 open: -1 = open(/etc/ssh_known_hosts, 0x8000), errno 2
102 139045 [main] ssh 2018 open: open(/etc/ssh_known_hosts2, 0x0)
16 139061 [main] ssh 2018 normalize_posix_path: src /etc/ssh_known_hosts2
15 139076 [main] ssh 2018 normalize_posix_path: /etc/ssh_known_hosts2 = normalize_posix_path (/etc/ssh_known_hosts2)
18 139094 [main] ssh 2018 mount_info::conv_to_win32_path: conv_to_win32_path (/etc/ssh_known_hosts2)
13 139107 [main] ssh 2018 mount_info::conv_to_win32_path: src_path /etc/ssh_known_hosts2, dst D:\tools\cygwin64\etc\ssh_known_hosts2, flags 0x30008, rc 0
18 139599 [main] ssh 2018 open: -1 = open(/etc/ssh_known_hosts2, 0x8000), errno 2
Unable to negotiate with 192.168.100.78 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
--//實際上系統配置在/etc/ssh_config.我開始修改D:\tools\cygwin64\etc\defaults\etc\sshd_config檔案不對。
--//把檔案D:\tools\cygwin64\etc\defaults\etc\sshd_config複製到D:\tools\cygwin64\etc\sshd_config,加入
Host *
KexAlgorithms +diffie-hellman-group1-sha1
--//一樣可以正常登入。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2735441/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20201120]使用event 10049.txt
- [20201124]建立Socket proxy使用SSH.txt
- Cygwin配置總結
- [20201119]安裝cygwin.txt
- Mingw、Cygwin和msys2
- win10怎麼解除安裝cygwin_win10如何完全解除安裝cygwinWin10
- Cygwin 安裝最新的 man pages
- Cygwin,在windows中使用linux命令WindowsLinux
- [20210901]cygwin下使用bbed.txt
- [20201120]pam_systemd(crondsession) Failed to create session Access denied.txtSessionAI
- MSYS2、MinGW、Cygwin 關係梳理
- cygwin安裝配置apt-cyg工具APT
- [20210802]cygwin文字回車換行問題.txt
- Win10安裝Cygwin-含淚推薦Win10
- 使用映象安裝cygwin、gcc並配置CLion IDE -2020.09.12GCIDE
- [openssh]windows 10使用cygwin安裝openssh服務端Windows服務端
- [20231029]使用cygwin調式bash shell引出的問題.txt
- 【Dr.Chen的計算機作業系統】Cygwin的安裝計算機作業系統
- undefined與null與?. ??UndefinedNull
- Promise與async/await與GeneratorPromiseAI
- for of 與 for in
- 程式與執行緒、同步與非同步、阻塞與非阻塞、併發與並行執行緒非同步並行
- forms元件補充與ModelForm簡單使用與cookie與sessionORM元件CookieSession
- Python學習筆記 5.0 元組 與 字典 與 集合 與 公共操作 與 推導式Python筆記
- 進與穩,時代與技術,新基建與華為雲
- jQuery與JavaScript與ajax三者的區別與聯絡jQueryJavaScript
- 聊聊執行緒與程式 & 阻塞與非阻塞 & 同步與非同步執行緒非同步
- Iterator與Iterable(迭代器與可迭代)
- 漏型與源型、PNP與NPN
- GRPC與 ProtoBuf 的理解與總結RPC
- PySpark與GraphFrames的安裝與使用Spark
- Process與Socket,Select與Accept關係
- PHP 與 Swoole 淺析與學習PHP
- rpm與yum,at與crontab,sed命令使用
- css(二):高度與文件流,line-box與box,寬度,position與CSS
- A與B
- js == 與 ===JS
- Docker與containerd的關係與區別DockerAI