delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/12/18:19:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Reply-To: Cygwin List <cygwin AT cygwin DOT com>
Message-Id: <6.2.1.2.0.20050712175921.09a71240@pop.prospeed.net>
Date: Tue, 12 Jul 2005 18:18:53 -0400
To: <FischRon DOT external AT infineon DOT com>, <cygwin AT cygwin DOT com>
From: Larry Hall <lh-no-personal-replies-please AT cygwin DOT com>
Subject: RE: ssh ceased to work after recreation of /etc/passwd
In-Reply-To: <25F7D2213F14794A8767B88203EA2BC9240CB8@mucse201.eu.infineo n.com>
References: <25F7D2213F14794A8767B88203EA2BC9240CB8 AT mucse201 DOT eu DOT infineon DOT com>
Mime-Version: 1.0

At 10:01 AM 7/12/2005, you wrote:
>> ># Before recreating /etc/passwd
>> >$ id
>> >uid=400(fischron) gid=401(mkpasswd)
>> >groups=544(Administrators),545(Users),10513(mkgroup_l_d),401(
>> mkpasswd)
>> >
>> ># After recreating /etc/passwd
>> >$ id
>> >uid=121833(fischron) gid=10513(mkgroup_l_d)
>> >groups=544(Administrators),545(Users),10513(mkgroup_l_d)
>> >
>> >I guess that the change in uid causes ssh to not to recognize me
>> >anymore.
>> >
>> >What's the best way to deal with this situation? Do I have 
>> to recreate
>> >id_rsa
>> >and id_rsa.pub (and redistribute my public key to all sites I need
>> >access to)?
>> 
>> 
>> The above error occurs in ssh-keygen.c when getpwuid(getuid) 
>> fails.  It 
>> appears Cygwin still thinks of you as uid 400. Just try stopping all 
>> Cygwin shells and services and then restarting (via 
>> cygwin.bat).  
>
>It was the other way around. I happened to have an "old" open shell
>where id was still seen as 400, and *there* did ssh work; but when
>I closed the window and opened a new shell, my numeric user id is
>now 121833 and ssh does not work anymore at all.


Ah-huh.  And did you do what I suggested?


>> You'll
>> probably find that you need to change the ownership of files 
>> in your home
>> directory (at least) to enable public key authentication again.
>
>You mean: changing all files to owner 121833? That is: Should I do this:
>
>  chown -R 121833 ~

Yep.

>But for the test of ssh, wouldn't it make more sense to chown the id_rsa
>file instead? Note that on my system, it is not in ~/.ssh, but in
>/cygdrive/h/.ssh. So I did a 
>
>  chown 121833 /cygdrive/h/.ssh/id_rsa

And /cygdrive/h isn't your home directory as far as Cygwin is concerned?
Later email from you in another thread suggests it is.  If not, you're
going to have problems anyway unless you've made special allowances 
when invoking 'ssh'.

>but ssh still fails.

Well, if you've done as I suggested and you're still having problems, it's
time to run the server in debug mode and see what you get from that.  This
should tell you pretty clearly why it's not working for you.  I find the 
most convenient way to debug the server is to create a new service that I
can run instead of the current.  That way I don't have to keep editing 
the registry or uninstalling and reinstalling.  I use something like this:

cygrunsrv -I sshd_debug -d "CYGWIN sshd debug" -p /usr/sbin/sshd -a -D -d -d -d 

Then stop your current sshd service and start the new one above.  Remember
you have to restart it after each ssh client session finishes.

Have fun! ;-)


--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019