delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/23/17:18:46

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: mounting network shares to make it persistent.
Date: Thu, 23 Jun 2005 14:17:26 -0700
Lines: 79
Message-ID: <d9f8he$shn$1@sea.gmane.org>
References: <8667c75d050623114741c247cf AT mail DOT gmail DOT com> <20050623194703 DOT GA15523 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317)
In-Reply-To: <20050623194703.GA15523@calimero.vinschen.de>
X-IsSubscribed: yes

Corinna Vinschen wrote:

> On Jun 23 11:47, Monkey Pet wrote:
>
>> I want to be able to access a resource (aka map) and make it available
>> the next time a user logs into ssh. I am using cywin with the open
>> ssh server.
>>
>> I would like know answers to the following questions:
>> 1. Can mount be given a username/password and domain?
>
>
> No.
>
>> 2. Is the net use command the correct command to use in the
>> cgywin environment.
>
>
> Yes.
>
>> 3. Any attempts to mount before starting ssh will not be
>> acceptable since the network shares will change from time to time.
>> Everything needs to be done over ssh for automation.
>>
>> Here is an example:
>>
>> ssh administrator AT ip
>> net use z: \\\\share\\fs2 password /USER:qadomain\\Administrator 
>> /PERSISTENT:No
>> (Share is available and accessible)
>> (logout)
>>
>> ssh administrator AT ip
>> (share is gone)
>>
>> Now do the following:
>> net use z: \\\\share\\fs2 password /USER:qadomain\\Administrator 
>> /PERSISTENT:No
>> mount \\\share\\fs2 /test
>> (Share is available and accessible)
>> (logout)
>>
>> ssh again
>> (share exists, but can't access directory until I do the "net use")
>
> I'm running sshd on Windows XP and I don't have to enter net use all 
> the time. The share is stored and accessible until reboot. But I don't 
> use a drive letter at all, this might make a difference.
>
> net use \\\\server\\share /USER:domain\\user passwd

I've never quite understood the fascination with drive letters. They are 
limited and they can change. Instead of doing something like:

$ net use z: \\\\server\\share /user:domain\\user passwd
$ more z:/file.txt

just do

$ more //share/fs2/file.txt

Or:

$ export z=//share/fs2
$ more $z/file.txt

If you just hate typing. (BTW: Use forward slashes - they work. IOW 
\\\\server\\share == //server/share! Caveat: Forward slashes work just 
find for Cygwin executables. The net use command, for example, is a 
Windows command and gets confused with forward slashes as it uses that 
for the options indicator - e.g. /user)

Benefit: Don't have to waste a drive letter. Also, if the drive letter 
is taken on this system (e.g. z is already mapped) you don't have to 
worry about it! Finally, the reference is exact and unambiguous!

-- 
Consider, the Bible was written by the same people who said the Earth 
was flat.


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019