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: ssh ceased to work after recreation of /etc/passwd


At 01:46 AM 7/13/2005, you wrote:

<snip>


>> >> 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.
>
>Incidentally, this does not work for many files. I get the error message
>
>  chown: changing ownership of ....: Permission denied
>
>This seems to be related to another a problem I am discussing here in
>the thread 
>with subject line "chmod suddenly ceased to work on old files - NEW
>FINDINGS".
>chown seems to fail exactly for those files where I also have no
>permission to
>do a chmod.


Yeah, that's certainly going to be a problem. You need to fix this before
you'll have much luck with permissions in general.  Maybe you just need to 
use Windows to take ownership of all these files.


>> 
>> >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?
>
>It is, but for historical reasons, id_rsa is under /cygdrive/c/.ssh and
>I always pass the correct id_rsa via the -i flag of ssh.

OK, that's fine then.  Permissions need change there as we discussed.




>> cygrunsrv -I sshd_debug -d "CYGWIN sshd debug" -p 
>> /usr/sbin/sshd -a -D -d -d -d 
>
>I don't have a sshd on my machine. I use Windows only as ssh client, in
>order to 
>access some Unix hosts. 
>
>As I have no root rights on these hosts, it will be difficult to run ssh
>in
>debug mode there.


OK, yeah yeah.  I remember that now.  I forgot that this was across 
platforms for the server.


<snip>



>So what I did is to manually edit /etc/passwd and set my user id back to
>400.
>Then I opened a new cygwin shell and, voila, ssh works again.
>
>Now the question is: What possible damage to my system could I have 
>introduced by manually changing the uid for my account in /etc/passwd?
>After all, I'm always a bit reluctant to hack around in my passwd
>file....


I expect you won't want to keep it this way but doing this for now is fine.
It just means the POSIX UID that Cygwin knows you as isn't the same as 
Windows.  This will mean that POSIX permissions that Cygwin creates on new 
files will be 400 instead of that of your domain user, so there may be more 
files to "fix" once your general permission issue is resolved.  But I expect 
that's not a problem for you.  The only thing you really don't want to edit 
in the passwd file is the Windows SUID, after the POSIX guid field.  The rest 
is fair game, though I temper that comment by saying that one shouldn't 
just start editing all these fields for fun (which I know is not the case 
for you). 



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


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