This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Windows 7 sshd can only login as cyg_server
- From: Bernd Prager <bernd at prager dot ws>
- To: cygwin at cygwin dot com
- Date: Tue, 26 Aug 2014 19:08:04 -0400
- Subject: Re: Windows 7 sshd can only login as cyg_server
- Authentication-results: sourceware.org; auth=none
- References: <53F6459F dot 5060203 at prager dot ws> <20140822130626 dot GK32314 at calimero dot vinschen dot de> <53F77CAB dot 4000800 at cygwin dot com> <20140822201933 dot GN32314 at calimero dot vinschen dot de> <53F7A865 dot 6030801 at cygwin dot com> <20140822204402 dot GP32314 at calimero dot vinschen dot de> <53F7B515 dot 8020704 at cygwin dot com> <20140825105139 dot GE11052 at calimero dot vinschen dot de> <20140825110043 dot GF11052 at calimero dot vinschen dot de> <53FB5B01 dot 60203 at cygwin dot com>
On 8/25/14 11:49 AM, Larry Hall (Cygwin) wrote:
On 08/25/2014 07:00 AM, Corinna Vinschen wrote:
On Aug 25 12:51, Corinna Vinschen wrote:
On Aug 22 17:24, Larry Hall (Cygwin) wrote:
On 08/22/2014 04:44 PM, Corinna Vinschen wrote:
<snip>
I solved it:
It turned out, that my Windows domain policy was updating local policies
in a way, that the local cyg_server account lost his group membership to
the group 'Administrators' every time I log into my Windows 7.
I have to fix that every time before I start sshd.
I wrote a little python script that does the whole thing. In case
someone wants to reuse it, enjoy:
#!/usr/bin/python
# -*- coding utf-8 -*-
import win32net
import win32serviceutil
user = "cyg_server"
group = "Administrators"
# make sure sshd user is in admin group
data = [ {"domainandname" : user} ]
mem, tot, res = win32net.NetLocalGroupGetMembers(None, group, 1)
inGroup = False
for item in mem:
if (item['name']) == user:
inGroup = True
break
if not inGroup:
win32net.NetLocalGroupAddMembers(None, "Administrators", 3, data)
# restart sshd
win32serviceutil.RestartService("sshd")
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple