內含多坑
項目需求:定時將內網的Linux客戶端文件定時上傳到公網阿里雲Windows服務器
使用工具:FreeSSHD
具體過程:
1、FreeSSHD下載地址
http://www.freesshd.com/?ctt=download
2、確保阿里雲開放了22端口,如果不用22端口,檢查一下其他端口是否打開,使用telnet命令
telnet 39.xxx.xxx.xxx port
如果顯示
正在連接39.xxx.xxx.xx...無法打開到主機的連接。 在端口 port: 連接失敗
說明改端口不可用,否則該端口可用
3、安裝後使用管理員權限運行
a) Server status
b) user properties
有3種方式,Public key (SSH only)可以不用每次輸入密碼,password stored as SHA1 hash普通的方式
使用Public key (SSH only)配置,將要連接到阿里雲的客戶端的機子的公鑰(id_rsa.pub)拷貝到C:\Program Files (x86)\freeSSHd目錄下,並且將id_rsa.pub重命名爲user。
密鑰生成
ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): [直接回車]
Enter passphrase (empty for no passphrase): [直接回車]
Enter same passphrase again: [直接回車]
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
...
3) SSH
這裏的Max number of connections:不能是0,否則連不上
4、服務裏面將FreeSSHDService 重啓即可更新配置