X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org X-IronPort-AV: E=McAfee;i="5200,2160,5241"; a="1025495" From: "Dang, Robin" To: "'cygwin AT cygwin DOT com'" Date: Fri, 29 Feb 2008 08:56:50 -0800 Subject: RE: Access to Network Drive under ssh Message-ID: <4A27D05E36DE7E47B96BCF7DD8F3FD7101307B3CAF@NASANEXMB04.na.qualcomm.com> References: <47C718A8 DOT 8080505 AT cygwin DOT com> In-Reply-To: <47C718A8.8080505@cygwin.com> Accept-Language: en-US Content-Language: en-US acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m1TGvcYm010561 Thanks Larry for your help. I managed to get the posted solution partially working and it is exactly what I was looking for. I only cannot get the shell script to run as a service. The service will attempt to start then fail, but it is really running. Does "exec" fork a process? I have tried both methods and .bash_login method although simpler is not a feasible solution in my situation. The reason is I am calling "ssh ", so the auto scripts do not run as I never go into the bash shell. Thank you, Robin -----Original Message----- From: Larry Hall (Cygwin) [mailto:reply-to-list-only-lh AT cygwin DOT com] Sent: Thursday, February 28, 2008 12:25 PM To: cygwin AT cygwin DOT com Subject: Re: Access to Network Drive under ssh Dang, Robin wrote: > http://cygwin.com/ml/cygwin/2006-06/msg00820.html > > I am having the same problems as in the discussion and would appreciate > any help to resolve it. After I log into a ssh session, the drives are not > automatically mapped and typing 'net use' gives me unavailable. I can map > them manually, but I need them to be mapped automatically to setup the > environment properly for my scripts. > > "Anyway, the way I generally get things... well, closer to working, is to > create a service that calls 'bash -c ', and have the > script issue a bunch of 'net use ' commands and then exec sshd. > That way you don't have to worry about connections being remembered, because > they will always be created for you when sshd starts up." > > In the post, there is a workaround for the problem, but I cannot write > the sshd-init-script and create the service to run it, so it works. Would anyone > provide anymore detail or instructions? I'd recommend: > Problem reports: http://cygwin.com/problems.html The thread you reference isn't doing anything more to remap the drives than you are manually. It's just automating the process. If that's all you need , then just put the "net use " in your .bash_login or other convenient spot that gets run each time you login. The process described above is just a more complicated way of getting here, albeit with certain advantages (it won't remap your drives every time you invoke bash -l). -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _____________________________________________________________________ A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? -- 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/