X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <4DC4655F.60708@bopp.net> Date: Fri, 06 May 2011 16:17:19 -0500 From: Jeremy Bopp User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Issue with SCP and SSH on Windows 7 References: <31561012 DOT post AT talk DOT nabble DOT com> In-Reply-To: <31561012.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 On 5/6/2011 12:54, Metroshica wrote: > > I have recently written a script in Windows Server Edition 2008 that SSHes > into a few linux servers, and then uses SCP to copy a file out of them. The > issue I'm having is with SSH keys getting set up, and cygwin trying to > create a .ssh directory in the C:/ directory, instead of where cygwin is > located. Check to make sure that you don't have the HOME environment variable configured to C:. If it is, you need to remove it just in case, but you may try adding it back once you get things working. Next, you need to check that the user account used to run scp has an entry in the /etc/passwd file within the Cygwin installation: grep ^the_user: /etc/passwd That won't output anything if the_user does not have an entry in that file. Otherwise, you'll see the record for the_user. If you see such a record, take a look at the path that appears between the last and second to last colons in the line. That path is the home directory that Cygwin programs such as the SSH tools will use. Set it to a Cygwin-style path that points to the proper location. If the grep command doesn't output anything, you can add an appropriate entry by running the following from the bash shell: mkpasswd -u the_user -d >>/etc/passwd If the account is *not* a domain account, use this instead: mkpasswd -u the_user -l >>/etc/passwd These changes should correct the issue by allowing the SSH family of programs to correctly find the user's home directory as configured under Cygwin. > I'm running this program through the standard windows command > prompt, not cygwin's shell, as it is an automated process, and I don't know > how to automatically run a program in cygwin. Anyone know how I can change > the home directory to be C:/cygwin/home/user instead of the base C:/ dir, or > anyone know how to automatically run a script in cygwin? Thanks for the > help. You should be fine with running things directly from Windows programs, including the command prompt, unless you need extra environment settings provided by Cygwin to login shells. Since you're otherwise running things successfully apparently, don't worry about changing this part. -Jeremy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple