public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* If Cygwin ssh, git, etc. can't find your .ssh directory
@ 2020-04-24 13:46 Mark Hansen
  2020-04-24 15:10 ` Mark Hansen
  2020-04-24 15:37 ` Thomas Wolff
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Hansen @ 2020-04-24 13:46 UTC (permalink / raw)
  To: cygwin

I had a case when I took my office laptop home and found that in the Cygwin environment,
commands were not able to find my .ssh directory. It seemed those commands didn't know
where my home directory was, and was defaulting to "/".

After asking on the Cygwin newsgroups, I received the following comment:

-------------------------------------------------------------------------
I also have had to deal with this problem. You should certainly read
https://cygwin.com/cygwin-ug-net/ntsec.html.

After much experimenting and consultation with Corinna, we decided the
best solution for me was:

   * Create /etc/passwd and /etc/group files
       o For /etc/passwd, I included just my account, and I actually
         editted it further to use my preferred username (rather than my
         domain username) and my correct home directory
   * Edit /etc/nsswitch.conf with:
       o passwd: files
       o group: files

This is not the generally recommended configuration, but in the
situation where you cannot reach the domain server, it may be the best
alternative. You may or may not need to back these changes out when you
are back at work. I have not had a problem at work, but we are only
loosely connected to the domain, so YMMV.
-------------------------------------------------------------------------

After making the changes, I rebooted the machine and now it seems to work.

Note that when using the PC from home, I also had to set the HOME environment
variable in the environment variable settings.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: If Cygwin ssh, git, etc. can't find your .ssh directory
  2020-04-24 13:46 If Cygwin ssh, git, etc. can't find your .ssh directory Mark Hansen
@ 2020-04-24 15:10 ` Mark Hansen
  2020-04-24 15:37 ` Thomas Wolff
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Hansen @ 2020-04-24 15:10 UTC (permalink / raw)
  To: cygwin

Sorry, this was a mistaken post. If an admin can do so, please delete it. Thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: If Cygwin ssh, git, etc. can't find your .ssh directory
  2020-04-24 13:46 If Cygwin ssh, git, etc. can't find your .ssh directory Mark Hansen
  2020-04-24 15:10 ` Mark Hansen
@ 2020-04-24 15:37 ` Thomas Wolff
  2020-04-24 21:42   ` Brian Inglis
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Wolff @ 2020-04-24 15:37 UTC (permalink / raw)
  To: cygwin

Am 24.04.2020 um 15:46 schrieb Mark Hansen:
> I had a case when I took my office laptop home and found that in the 
> Cygwin environment,
> commands were not able to find my .ssh directory. It seemed those 
> commands didn't know
> where my home directory was, and was defaulting to "/".
>
> After asking on the Cygwin newsgroups, I received the following comment:
>
> -------------------------------------------------------------------------
> I also have had to deal with this problem. You should certainly read
> https://cygwin.com/cygwin-ug-net/ntsec.html.
>
> After much experimenting and consultation with Corinna, we decided the
> best solution for me was:
>
>   * Create /etc/passwd and /etc/group files
>       o For /etc/passwd, I included just my account, and I actually
>         editted it further to use my preferred username (rather than my
>         domain username) and my correct home directory
>   * Edit /etc/nsswitch.conf with:
>       o passwd: files
>       o group: files
>
> This is not the generally recommended configuration, but in the
> situation where you cannot reach the domain server, it may be the best
> alternative. You may or may not need to back these changes out when you
> are back at work. I have not had a problem at work, but we are only
> loosely connected to the domain, so YMMV.
> -------------------------------------------------------------------------
>
> After making the changes, I rebooted the machine and now it seems to 
> work.
>
> Note that when using the PC from home, I also had to set the HOME 
> environment
> variable in the environment variable settings.
> Sorry, this was a mistaken post. If an admin can do so, please delete 
> it. Thanks.
Not sure why you consider this mistaken. I'm not sure whether it's 
related but occasionally I also have a problem with ssh not finding 
.ssh. It's caused by ssh looking for ~/.ssh while my config dir is in 
$HOME/.ssh. These are generally assumed to be the same, but sometimes I 
observe the idea of bash what ~ means to get broken, without noticeable 
pattern so fare. It then points to /home/$USER while I've configured may 
HOME on one machine to be somewhere else. Weird...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: If Cygwin ssh, git, etc. can't find your .ssh directory
  2020-04-24 15:37 ` Thomas Wolff
@ 2020-04-24 21:42   ` Brian Inglis
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2020-04-24 21:42 UTC (permalink / raw)
  To: cygwin

On 2020-04-24 09:37, Thomas Wolff wrote:
> Am 24.04.2020 um 15:46 schrieb Mark Hansen:
>> I had a case when I took my office laptop home and found that in the Cygwin
>> environment,
>> commands were not able to find my .ssh directory. It seemed those commands
>> didn't know
>> where my home directory was, and was defaulting to "/".
>>
>> After asking on the Cygwin newsgroups, I received the following comment:
>>
>> -------------------------------------------------------------------------
>> I also have had to deal with this problem. You should certainly read
>> https://cygwin.com/cygwin-ug-net/ntsec.html.
>>
>> After much experimenting and consultation with Corinna, we decided the
>> best solution for me was:
>>
>>   * Create /etc/passwd and /etc/group files
>>       o For /etc/passwd, I included just my account, and I actually
>>         editted it further to use my preferred username (rather than my
>>         domain username) and my correct home directory
>>   * Edit /etc/nsswitch.conf with:
>>       o passwd: files
>>       o group: files
>>
>> This is not the generally recommended configuration, but in the
>> situation where you cannot reach the domain server, it may be the best
>> alternative. You may or may not need to back these changes out when you
>> are back at work. I have not had a problem at work, but we are only
>> loosely connected to the domain, so YMMV.
>> -------------------------------------------------------------------------
>>
>> After making the changes, I rebooted the machine and now it seems to work.
>>
>> Note that when using the PC from home, I also had to set the HOME environment
>> variable in the environment variable settings.
>> Sorry, this was a mistaken post. If an admin can do so, please delete it. Thanks.

> Not sure why you consider this mistaken. I'm not sure whether it's related but
> occasionally I also have a problem with ssh not finding .ssh. It's caused by ssh
> looking for ~/.ssh while my config dir is in $HOME/.ssh. These are generally
> assumed to be the same, but sometimes I observe the idea of bash what ~ means to
> get broken, without noticeable pattern so fare. It then points to /home/$USER
> while I've configured may HOME on one machine to be somewhere else. Weird...

Entries under /home/ are not modified by Cygwin setup, so it is safe to:

	$ ln -s /proc/cygdrive/c/Users/$USER /home/

which ensures that your Cygwin and Windows home dirs match.

If you tried to e.g.

	$ ln -sT /proc/cygdrive/c/Users /home

Cygwin setup would just remove that link and recreate the directory next run.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-24 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-24 13:46 If Cygwin ssh, git, etc. can't find your .ssh directory Mark Hansen
2020-04-24 15:10 ` Mark Hansen
2020-04-24 15:37 ` Thomas Wolff
2020-04-24 21:42   ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).