This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: who is root? (or /usr/bin/sshd fails to start because of /var/log ownership)


On Tue, Mar 17, 2015 at 4:45 PM, Mirko Vukovic <mirko.vukovic@gmail.com> wrote:
> On Tue, Mar 17, 2015 at 10:24 AM, Corinna Vinschen
> <corinna-cygwin@cygwin.com> wrote:
>> On Mar 17 10:10, Mirko Vukovic wrote:
>>> Hello,
>>>
>>> A few weeks ago, sshd stopped working after a cygwin64 update.  I
>>> reinstalled cygwin64 (because of the new user and password handling, I
>>> figured that to be easiest).
>>>
>>> I still cannot get sshd to run.  I get an error message:
>>> >/usr/sbin/sshd.exe -d
snip
>>> /var/empty must be owned by root and not group or world-writable.
>>>
>>> Here is what /var/empty looks like (I obfuscated the machine name part)
>>> >ls -lrd /var/empty
>>> drw-------+ 1 XXXXXXXXXX+cyg_server Administrators 0 Feb 25 09:41 /var/empty/
>>>
>>> There is no root user on my machine.  Should I create it?
>>
>> No.  The "must be owned by root" in sshd is the original upstream error
>> message.  The test leading to the message on the other hand is tweaked
>> for Cygwin to test if the /var/empty file is owned by the user running
>> sshd.  So, if you run sshd from the command line, it refuses to run if
>> /var/empty isn't owned by your current user account.  If you're running
>> sshd as service from the XXXXXXXXXX+cyg_server account, /var/empty must
>> be owned by the XXXXXXXXXX+cyg_server account.
>>
>> Does that help?
>>
>>
>> Corinna
>>
>> --
>> Corinna Vinschen                  Please, send mails regarding Cygwin to
>> Cygwin Maintainer                 cygwin AT cygwin DOT com
>> Red Hat
>
> (Good news, bad news)
>
> Good news: I can start sshd as a user, and ssh to localhost.
>
> In bash ran as administrator:
> - >chown myself /var/empty
> - >/usr/bin/sshd -d
>
> In another bash:
> ->ssh localhost.
> works
>
> Bad news:
>
> sshd cannot start as service (after I revert the /var/empty/ ownership
> as before).
>
> I start it manually under windows services, it starts and then stops.
> So it seems that it does log in.
> In /var/log/sshd.log, I see again:
> /var/empty must be owned by root and not group or world-writable
>
> I do not see a login failure in the event manager.
>
> When I look in services, sshd is set to log in as a Local System
> Account.  Changing to
> .\cyg_server does not help.  I don't want to bore you with the
> details, in case I am going
> the wrong way, but should sshd log in as a local service (the initial
> setting), cyg_server, or sshd?
>
> (I set the parameters to sshd to -d in the services, but I did not see
> any output in sshd.log).
>
> Thank you
>
> Mirko

Um, after looking at application messages, I found messages that indicated that
sshd was actually running.

After a reboot, ps -W | grep ssh confirmed that.

ssh localhost works.

But in services, sshd is not listed as running.

To summarize:

I have sshd installed as a service, set to log in as .\cyg_server. (I
had to do that manually,
after ssh-host-config).

I also manually had to fix the read-write permissions to 600.

Things seem to work now.

Thank you Corinna and Larry for reading and replying.

Mirko

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]