CyGwin使用

CyGwin是一款在windows下使用的unix终端, 不用安装虚拟机, 也不用安装linux系统

1. 下载地址

模块: Base,Devel,Libs,Net,System,Utils
这里写图片描述

2.新建系统变量

  • CYGWIN ntsec tty
  • 追加path cygwin/bin路径

3. 初始化ssh-host-config

Should StrictModes be used? (yes/no)

no

Do you want to install sshd as a service?
(Say "no" if it is already installed as a service) (yes/no)

yes

Enter the value of CYGWIN for the daemon: []

填写 ntsec

Do you want to use a different name? (yes/no)

no

```
Please enter the password for user 'cyg_server':
Reenter:

创建rsa秘钥(免密码登录环节, 不是必须环节)

ssh-keygen  -t  rsa
cp  ~/.ssh/id_rsa.pub  ~/.ssh/authorized_keys

启动sshd服务

net start sshd

连接测试

ssh  localhost

Cygwin命令
net start sshd………………..开启sshd服务
net stop sshd………………..关闭sshd服务
cygrunsrv -E sshd………….删除sshd服务
cygrunsrv -R sshd………….删除sshd服务
ssh-host-config -y 重新配置

检查一下系统服务中是否有 CYGWIN sshd 服务, 无启动帐号
检查系统用户 sshd 是否已启用, 并属于管理员组.
一切正常,即可启动ssh服务. 登录的用户名是sshd, 密码是 sshd用户的密码.

注意: 使用 windows 用户本地认证
mkpasswd -l > /etc/passwd 使用windows 用户的密码
mkgroup -l > /etc/group 使用windows 用户组

cyg_server / admin


自己的心得

账号是当前登录到windows的账号, 密码是登录密码, 账号区分大小写, 如果不对, 删除sshd服务器, 删除/home下所有用户文件夹以及/etc/ssh*所有文件, 重新执行ssh-host-config

中间用过这个, 服务里面是本地账号
mkpasswd -l > /etc/passwd
mkgroup -l > /etc/group

猜你喜欢

转载自blog.csdn.net/qq351469076/article/details/80403645