# ssh-server **Repository Path**: liulongBlog/ssh-server ## Basic Information - **Project Name**: ssh-server - **Description**: 使用sshd-mina构建一个ssh-server,附带sftp,scp - **Primary Language**: Java - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 5 - **Created**: 2020-11-27 - **Last Updated**: 2023-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ###智睿主机: `string cmd = string("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -CTfnN -R 0.0.0.0:0:127.0.0.1:22 ")+user+"@"+tunnelServerIp +" -p"+tunnelServerPort+string(" > ") +string(logFile)+string(" 2>&1");` ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -CTfnN -R 0.0.0.0:0:127.0.0.1:22 hj@172.25.240.84 -p 2222 ###9531主机: `string cmd = string("tail -f /dev/null | ssh -T -y -y -R 0.0.0.0:"+bindRemotePort+":127.0.0.1:22 ")+user+"@"+tunnelServerIp +" -p"+tunnelServerPort+string(" -i /home/hj/smarthome/script/kk_secret_key > ") +string(logFile)+string(" 2>&1 &");` 命令: ```cd /home/hj/smarthome/script ssh -T -y -y -R 0.0.0.0:25879:127.0.0.1:22 hj@172.25.240.25 -p 2222 -i kk_secret_key``` 成功使用xshell连接 ssh hj@172.25.240.25 -p 25879输入 root p9z34c即可连接上