How do I change the default home directory after I fire up cygwin?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I change the default home directory after I fire up cygwin?

Yves
Hi, this is my issue:

I start up cygwin and do pwd, and this is my home directory.
$ pwd
/cygdrive/h

But, I don't want it to be in /cygdrive/h.  So, what gives?  I've run the mkpasswd command like so (while in my /home/<my name> directory):
mkpasswd -l -p "$(cygpath -H)" > /etc/passwd

At that point, I close my cygwin window and open it again... and same thing when I run pwd.  How do I make cygwin think and start in /home/<my name>?
I've even mucked with the /etc/passwd for my user account and STILL no result.
Very confused...

P.S.: If this message shows up twice, I didn't mean to, was having a difficult time trying to post to the mailing list.
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

marco atzeri-4
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

Andrey Repin-3
In reply to this post by Yves
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

Yves
This post was updated on .
In reply to this post by marco atzeri-4
Hi, thanks for your reply.

I did cat /etc/passwd.  I obfuscated certain portions of the output, all of which are characters (no numbers, no spaces, no special characters, all lower case):

<user name>@FOOBAR /home/<user name>/Downloads
$ cat /etc/passwd
SYSTEM:*:18:544:,S-1-5-18::
LocalService:*:19:544:U-NT AUTHORITY\LocalService,S-1-5-19::
NetworkService:*:20:544:U-NT AUTHORITY\NetworkService,S-1-5-20::
Administrators:*:544:544:,S-1-5-32-544::
TrustedInstaller:*:4294967294:4294967294:U-NT SERVICE\TrustedInstaller,S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464::
<user name>:unused:1003:513:<user name>,U-FOOBAR\<user name>,S-1-5-21-1225255616-1463261690-3474574673-1003:/cygdrive/c/cygwin/home/<user name>:/bin/bash

I've set the home to /home/<user name> before, closed cygwin and opened it again, no change.

I'd do pwd, see that I'm in /cygdrive/h, then I'd execute cd (no parameters, just the command) and I'd be in /cygdrive/h again.  No idea why....
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

Yves
In reply to this post by Andrey Repin-3
I did echo $HOME and this is the output that I got:
/cygdrive/h
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

Yves
Ok, so if I do HOME=/home/<user name> I go to the home directory that I want to go to.  Yes!  But when I close my cygwin window and then re-open it, I'm back in /cygdrive/h... hmm...
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

David T-G-4
In reply to this post by Andrey Repin-3
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

Yves
This machine is on a corporate network, I'm doing this setup at work :) .  And yes, there's a domain.

And, after looking at System variables, I found HOME which is pointed to H:\.  Would it make sense to just set that to C:\cygwin\home\<user name>?
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

Yves
Ok, so I changed HOME in Environment variables to C:\cygwin\home\<user name> and when I do pwd, this is what happens:
/cygdrive/c/cygwin/home/<user name>

Ok... it's not /home/<user name>, but it's progress :) .
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

Andrew DeFaria-2
In reply to this post by Andrey Repin-3
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: How do I change the default home directory after I fire up cygwin?

Andrew DeFaria-2
In reply to this post by Yves
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

RE: How do I change the default home directory after I fire up cygwin?

Adam Dinwoodie
In reply to this post by Yves
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

RE: How do I change the default home directory after I fire up cygwin?

Yves
Yes!  It works just like I expect it to work!  Thanks guys!