Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-SBRS: None content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: ssh ceased to work after recreation of /etc/passwd Date: Wed, 13 Jul 2005 07:46:00 +0200 Message-ID: <25F7D2213F14794A8767B88203EA2BC9240CBB@mucse201.eu.infineon.com> From: To: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j6D5kJtS030504 > >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? Yes > >> 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. > > >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. > 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 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. I have the feeling that all trouble I'm having, is connected to two problems. One is some kind of weird permission problem and means that I can't chmod some (quite a few actually) files, and that I can't chown them (but note that I *can* chown id_rsa!). This symptom suddenly became evident a few weeks ago. The second problem is that ssh ceased to work. It ceased to work, as far as I can tell, after I had recreated /etc/passwd and /etc/group, and the most noticeable difference between the passwd before, and the passwd after, is that the user id had changed during recreation. 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.... Ronald -- 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/