delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/22/14:33:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
From: Alexis Huxley <ahuxley AT eso DOT org>
Date: Wed, 22 Oct 2003 20:31:12 +0200
To: cygwin AT cygwin DOT com
Subject: SSH into XP: mapped network drives disappeared!
Message-ID: <20031022183112.GA18629@te35.hq.eso.org>
Reply-To: Alexis Huxley <ahuxley AT eso DOT org>
Mime-Version: 1.0
User-Agent: Mutt/1.4i
X-Virus-Scanned: by amavisd-milter (http://amavis.org/)
X-Scanned-By: MIMEDefang 2.35

The short version
-----------------

How do I stop XP from hiding my mapped network drives from me, when 
I make a slogin to XP using Cygwin+SSH?

The long version
----------------

Hi :-) I've hunted a lot on the web and mailing list archives, so I
know a lot of people have had this same problem, but I haven't seen
anybody answer it in a way that worked for me yet, so ...

I downloaded and installed Cygwin yesterday on a XP system where my
home is not local: the passwords are managed centrally (a 'domain' 
account, right?) and the disk space is on a SAN/NAS thing, which
is accessible to XP and to Unix machines.

As 'Administrator' I ran the 'mkpasswd -l -d > /etc/passwd' and the
same for the groups file. (Actually first I tried it as myself, but
with the '-d' option it bombed out before getting the entry for
me with 'mkpassed: [5] Access denied', so then I tried as Administrator
and everything went well.)

I modified my $HOME in /etc/passwd to be /cygdrive/y, which the XP PC
has mapped to my home directory in the storage server. My ~/.profile
sufficiently OS-independent, that this works under Cygwin/XP and on
any of the various Unixes we run. Great so far.

One of the Cygwin components installed was SSH. I configured the server as
explained at http://tech.erdelynet.com/cygwin-sshd.html.

Ok, so now, when I run Cygwin from the XP machine itself (i.e. not through
slogin) then I see the following network drives:

        pc004545$ pwd
        /cygdrive/y
        pc004545$ ls
        <stuff in my home>
        pc004545$ cd /cygdrive    
        pc004545$ ls              
        c  d  g  h  y             
        pc004545$                 

(My ~/.profile is changing the prompt from the Cygwin default.)

Now for the problem: when I 'slogin' into the XP box, I have no problems
being authenticated (not after I ran mkpasswd as 'Administrator' anyway), 
but '/cygdrive/y' is 'invisible' to my login shell, and I get a whole 
slew of errors accordingly:

        pc004545$ slogin localhost
        ahuxley AT localhost's password:
        Could not chdir to home directory /cygdrive/y: No such file or directory
        mkdir: cannot create directory `/cygdrive/y': No such file or directory
        Copying skeleton files.
        These files are for the user to personalise
        their cygwin experience.
        
        These will never be overwritten.
        
        /usr/bin/install: cannot create directory `/cygdrive/y': No such file or directory
        /usr/bin/install: cannot create directory `/cygdrive/y': No such file or directory
        /usr/bin/install: cannot create directory `/cygdrive/y': No such file or directory
        -bash: cd: /cygdrive/y: No such file or directory
        
        ahuxley AT PC004545 /etc/skel          <---- all of this is the prompt
        $                                   <---- still part of the prompt

'net use' before the 'slogin' shows the Y: drive, and obviously I can
cd to /cygdrive/y. 'net use' after 'slogin' shows Y: is there but "not 
available", and attempting to cd to /cygdrive/y obviously fails.

I've read, and indeed this 'net use' check seems to confirm, that this is 
not a Cygwin problem at all, but an XP problem.

So the question: what do I have to do XP to make it stop hiding my mapped
drives from my when I slogin?

Oh, one more thing: I saw people saying that you can just use 'net use ...'
but assign different drive letters each time. Unfortunately, since the drive 
I want to map is my home directory, and path to this (as it appears on the PC)
is written in /etc/passwd, and I can't/won't change /etc/passwd for each 
concurrent SSH I start, the solution must be one which makes the drive 
have a consistent mount/access point under XP. 

Also note, that the shell tries to put me in that home *before* /etc/profile
or ~/.profile are run, so some sort of 'net use <next-letter> //server/path;
ln -s ....' in /etc/profile probably isn't going to cut it.

Does anybody know the 'correct' solution to this problem? Many thanks!

Alexis Huxley

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