public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Larry Hall <cygwin-lh@cygwin.com>
To: Tim Shadel <timshadel@pobox.com>, cygwin@cygwin.com
Subject: Re: sshd, plink, bash and path problems
Date: Thu, 06 May 2004 02:26:00 -0000	[thread overview]
Message-ID: <6.1.0.6.0.20040505221846.031cf5c0@127.0.0.1> (raw)
In-Reply-To: <40999B63.8080305@pobox.com>

At 09:56 PM 5/5/2004, you wrote:
>I'm not subscribed to the list.  Kindly CC: me in any threads that result from this email.  Thanks.
>
>Here's my setup:
>
>Client:  Win2K box with Putty/Plink
>Server: Win2K professional with cygwin/sshd (actually copssh, but it's just a minimal cygwin install)
>
>I can login just fine.  I can use public key authentication fine.
>
>Here's what I'd like to do:
>
>plink -batch -2 -i C:\path\to\my\key\mykey.PPK -l tims 159.87.127.66 mkdir -p /var/some/dir/that/does/not/exist
>
>Nothing happens.  Here's something else I tried to see what's going on:
>
>plink -batch -2 -i C:\path\to\my\key\mykey.PPK -l tims 159.87.127.66 echo $PATH
>/cygdrive/c/j2sdk...
>
>Basically my entire Windows path prints out -- NOT my cygwin path.  I saw another post on this in a different context (http://www.cygwin.com/ml/cygwin/2003-07/msg01700.html), and I can see that it's a matter of commands getting executed when the login process happens.  So then I tried this:
>
>plink -batch -2 -i C:\path\to\my\key\mykey.PPK -l tims 159.87.127.66 source /etc/profile; echo $PATH
>/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT
>
>And got the output I expected.  BUT, the plink command is being issued by a program that I can't modify (apache's maven deploy plugin), so I wondered two things:
>
>1. What's different between plink <host> <command> and plink <host> (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?
>
>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 <command> happens?
>
>Any help with this would be most appreciated.


Sorry, I don't use putty or plink (and actually since they aren't part of 
the Cygwin distribution, much discussion of them is off-topic for this 
list).  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'

Does that clarify what's going on 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/

  reply	other threads:[~2004-05-06  2:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-06  1:57 Tim Shadel
2004-05-06  2:26 ` Larry Hall [this message]
2004-05-06 18:01   ` Tim Shadel
2004-05-06 19:03     ` Igor Pechtchanski
2004-05-06 21:41       ` Tim Shadel
2004-05-06 21:47         ` Igor Pechtchanski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6.1.0.6.0.20040505221846.031cf5c0@127.0.0.1 \
    --to=cygwin-lh@cygwin.com \
    --cc=cygwin@cygwin.com \
    --cc=timshadel@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).