cygwin ssh permission denied

from : http://www.noah.org/wiki/Sshd_on_Windows#ssh:_Permission_denied

This is obsolete in newer versions of Cygwin, but may come in handy if reconfiguring or in debugging a problem.

Contents

Cygwin SSHD HowTo -- How to run the OpenSSH SSHD server on Windows using Cygwin

Install the following Cygwin packages (rerun setup if necessary -- you can add packages after you have already installed Cygwin).

   Admin --> cygrunsrv
   Net --> openssh

Open a new bash shell window and run the SSH configure stuff.

   ssh-host-config -y

This step will create necessary configuration files, a privilege separation user and necessary directories.

When prompted with "CYGWIN=" type for following:

   tty ntsec

Now you are ready to start the service.

   cygrunsrv -S sshd

Problems

ssh: Permission denied

Problem: you can't login to your account. You set the password using `passwd`, but it still gives you this error.

Solution: The problem is that sometime Cygwin does not create your local user in the /etc/passwd file. The solution is simple:

mkpasswd.exe -l > /etc/passwd

Now you should see your Windows user in the passwd file. Now use the `passwd` command to give yourself a password for the Cygwin user. This is not the same as the Windows user.

Win32 error 1062

Sometimes you get a sshd/cygrunsrv service error after trying to run the service.

   cygrunsrv: Error starting a service:
   QueryServiceStatus: Win32 error 1062:
   The service has not been started.

There can be a couple of causes for this. The following may fix the problem (this is not an option on XP Home).

Solution 1

You may have an old or corrupt installation of Cygwin. Try reinstalling. The following may also help:

cygrunsrv -R sshd

REBOOT (or use the Task Manager to kill all instances of sshd that may be running in the background) run "ssh-host-config -y" again. This seemed to help on a few systems I worked on.

Solution 2

Open an explorer window and use the "Properties | Security" dialog and explicitly add "Full Control" for the SYSTEM user to the following directories:

   C:/Cygwin
   C:/Cygwin/var
   C:/Cygwin/var/log
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值