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 Message-ID: <409A7C79.1000006@pobox.com> Date: Thu, 06 May 2004 10:57:13 -0700 From: Tim Shadel User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) MIME-Version: 1.0 To: Cygwin List CC: Larry Hall Subject: Re: sshd, plink, bash and path problems References: <40999B63 DOT 8080305 AT pobox DOT com> <6 DOT 1 DOT 0 DOT 6 DOT 0 DOT 20040505221846 DOT 031cf5c0 AT 127 DOT 0 DOT 0 DOT 1> In-Reply-To: <6.1.0.6.0.20040505221846.031cf5c0@127.0.0.1> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I'm not subscribed to the list. Kindly CC: me in any threads that result from this email. Thanks. Larry Hall wrote: > Sorry, I don't use putty or plink (and actually since they aren't part > ofthe Cygwin distribution, much discussion of them is off-topic for > this list). Understood. I'll try rephrase my original question in terms of ssh. > But I expect your problem isn't putty/plink specific but rather > operator-error. I can reproduce the same "problem" you're reporting > with 'ssh' (which is part of the Cygwin distribution). I believe you want: > >plink -batch -2 -i C:\path\to\my\key\mykey.PPK -l tims 159.87.127.66 'echo $PATH' > > Hmm. I tried to replicate this with 'ssh' as well, after you mentioned it. Here's what I did: 1. Use Putty to connect to the cygwin machine via SSH. 2. Use 'ssh-keygen' to create a key on the cygwin machine, and add it to the authorized_keys file. 3. Use 'ssh-agent' and 'ssh-add' to hold my key in memory so it can be used without a prompt 4. Use 'ssh localhost ' to simulate the 'plink' setup I described earlier What I found is this: (a) ssh localhost echo $PATH returned the correct cygwin path, but (b) ssh localhost 'echo $PATH' returned the full Windows path, not the cygwin path, and (c) ssh localhost "echo $PATH" returned the correct cygwin path as well. But as I think about it, I actually can't change the quotes used around the command (since it's issued by a program over which I have no control). What I CAN manipulate is the cygwin environment contacted by the ssh/plink program. >1. What's different between plink and plink (which displays a prompt) that causes the magical "login" process to occur. Is this a plink thing? a bash thing? a cygwin-version-of-either thing? > > Let me rephrase this a bit. What happens differently between (a) and (b) above on the _server_ side? >2. Is there a file (.rc something-or-other perhaps?) that I can create that will make the "source /etc/profile" call once plink connects, so I can have the right path when happens? > > Can I change the cygwin environment (server side) to handle both (a) and (b) in the same way? I'm familiar with Linux, but Cygwin (and especially its interaction with Windows: environment, permissions, etc) is brand new to me. The quotation difference is step in the right direction (I know what to rule out), and I'm sure with a bit more info I'll be able solve my problem. I appreciate your help. Thanks, Tim -- 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/