public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problems with ssh when I log into my PC using my corporate domain while working from home
@ 2020-04-21 15:33 Mark Hansen
  2020-04-21 21:52 ` Mark Hansen
  2020-04-23 17:26 ` ASSI
  0 siblings, 2 replies; 14+ messages in thread
From: Mark Hansen @ 2020-04-21 15:33 UTC (permalink / raw)
  To: cygwin

I have a Windows 10 laptop, on which I installed Cygwin. I always log into the machine using
my corporate domain account. When I log into the machine from my office, everything Cygwin
works fine.

When I log into my laptop from home (which I'm working from home for a while now, due to
COVID-19), I still log in using my corporate domain account, but Cygwin acts differently.

Here is my user id (from the id command) when I log in from the office:

uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...

Here is the same when I've logged in with the machine at home:

uid=1293438(MAN+User(244862)) gid=1293438

(MAN) is the domain.

The actual problem I'm having is that Cygwin tools like ssh, git, etc. can't find my .ssh
directory. They are looking in "/" rather than my home directory.

I tried copying my .ssh directory from my home to "/" and although it was created, the
files have the wrong permissions and I'm unable to change them.

Is there something I can tweak to get Cygwin to understand which user I am so the ssh
stuff can start working again?

Thanks for any help.


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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-21 15:33 Problems with ssh when I log into my PC using my corporate domain while working from home Mark Hansen
@ 2020-04-21 21:52 ` Mark Hansen
  2020-04-23 11:54   ` Mark Hansen
  2020-04-23 17:26 ` ASSI
  1 sibling, 1 reply; 14+ messages in thread
From: Mark Hansen @ 2020-04-21 21:52 UTC (permalink / raw)
  To: cygwin

On 4/21/2020 8:33 AM, Mark Hansen wrote:
> I have a Windows 10 laptop, on which I installed Cygwin. I always log into the machine using
> my corporate domain account. When I log into the machine from my office, everything Cygwin
> works fine.
> 
> When I log into my laptop from home (which I'm working from home for a while now, due to
> COVID-19), I still log in using my corporate domain account, but Cygwin acts differently.
> 
> Here is my user id (from the id command) when I log in from the office:
> 
> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
> 
> Here is the same when I've logged in with the machine at home:
> 
> uid=1293438(MAN+User(244862)) gid=1293438
> 
> (MAN) is the domain.
> 
> The actual problem I'm having is that Cygwin tools like ssh, git, etc. can't find my .ssh
> directory. They are looking in "/" rather than my home directory.
> 
> I tried copying my .ssh directory from my home to "/" and although it was created, the
> files have the wrong permissions and I'm unable to change them.
> 
> Is there something I can tweak to get Cygwin to understand which user I am so the ssh
> stuff can start working again?
> 
> Thanks for any help.
> 

To answer a question posed by someone to my private e-mail:

I didn't have the HOME environment variable set at first. When the PC is at my office,
Cygwin worked fine. When I took the PC home and logged in there, I had severe Cygwin
issues - I wasn't able to open a Cygwin Terminal or an XTerm terminal - it seemed it
didn't know where my HOME directory was.

As a result, I set my HOME directory in the environment settings for my user. Once I
did that, I was able to use the Cygwin Terminal and XTerm terminals again.

The only thing that is still not working (as far as I can see) is any ssh client which
needs to find the .ssh directory (like ssh or git, etc.).


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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-21 21:52 ` Mark Hansen
@ 2020-04-23 11:54   ` Mark Hansen
  2020-04-23 12:51     ` Marco Atzeri
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Hansen @ 2020-04-23 11:54 UTC (permalink / raw)
  To: cygwin

On 4/21/2020 2:52 PM, Mark Hansen wrote:
> On 4/21/2020 8:33 AM, Mark Hansen wrote:
>> I have a Windows 10 laptop, on which I installed Cygwin. I always log into the machine using
>> my corporate domain account. When I log into the machine from my office, everything Cygwin
>> works fine.
>> 
>> When I log into my laptop from home (which I'm working from home for a while now, due to
>> COVID-19), I still log in using my corporate domain account, but Cygwin acts differently.
>> 
>> Here is my user id (from the id command) when I log in from the office:
>> 
>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>> 
>> Here is the same when I've logged in with the machine at home:
>> 
>> uid=1293438(MAN+User(244862)) gid=1293438
>> 
>> (MAN) is the domain.
>> 
>> The actual problem I'm having is that Cygwin tools like ssh, git, etc. can't find my .ssh
>> directory. They are looking in "/" rather than my home directory.
>> 
>> I tried copying my .ssh directory from my home to "/" and although it was created, the
>> files have the wrong permissions and I'm unable to change them.
>> 
>> Is there something I can tweak to get Cygwin to understand which user I am so the ssh
>> stuff can start working again?
>> 
>> Thanks for any help.
>> 
> 
> To answer a question posed by someone to my private e-mail:
> 
> I didn't have the HOME environment variable set at first. When the PC is at my office,
> Cygwin worked fine. When I took the PC home and logged in there, I had severe Cygwin
> issues - I wasn't able to open a Cygwin Terminal or an XTerm terminal - it seemed it
> didn't know where my HOME directory was.
> 
> As a result, I set my HOME directory in the environment settings for my user. Once I
> did that, I was able to use the Cygwin Terminal and XTerm terminals again.
> 
> The only thing that is still not working (as far as I can see) is any ssh client which
> needs to find the .ssh directory (like ssh or git, etc.).
> 

Assuming Cygwin doesn't know about my user (when the PC is at home) - is there something
I can run to reset what Cygwin thinks is the user?

Otherwise, I'll try reinstalling Cygwin and see if that helps.


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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 11:54   ` Mark Hansen
@ 2020-04-23 12:51     ` Marco Atzeri
  2020-04-23 15:25       ` Mark Hansen
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Atzeri @ 2020-04-23 12:51 UTC (permalink / raw)
  To: cygwin

Am 23.04.2020 um 13:54 schrieb Mark Hansen:
> On 4/21/2020 2:52 PM, Mark Hansen wrote:
>> On 4/21/2020 8:33 AM, Mark Hansen wrote:
>>> I have a Windows 10 laptop, on which I installed Cygwin. I always log 
>>> into the machine using
>>> my corporate domain account. When I log into the machine from my 
>>> office, everything Cygwin
>>> works fine.
>>>
>>> When I log into my laptop from home (which I'm working from home for 
>>> a while now, due to
>>> COVID-19), I still log in using my corporate domain account, but 
>>> Cygwin acts differently.
>>>
>>> Here is my user id (from the id command) when I log in from the office:
>>>
>>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>>>
>>> Here is the same when I've logged in with the machine at home:
>>>
>>> uid=1293438(MAN+User(244862)) gid=1293438
>>>
>>> (MAN) is the domain.
>>>
>>> The actual problem I'm having is that Cygwin tools like ssh, git, 
>>> etc. can't find my .ssh
>>> directory. They are looking in "/" rather than my home directory.
>>>
>>> I tried copying my .ssh directory from my home to "/" and although it 
>>> was created, the
>>> files have the wrong permissions and I'm unable to change them.
>>>
>>> Is there something I can tweak to get Cygwin to understand which user 
>>> I am so the ssh
>>> stuff can start working again?
>>>
>>> Thanks for any help.
>>>
>>
>> To answer a question posed by someone to my private e-mail:
>>
>> I didn't have the HOME environment variable set at first. When the PC 
>> is at my office,
>> Cygwin worked fine. When I took the PC home and logged in there, I had 
>> severe Cygwin
>> issues - I wasn't able to open a Cygwin Terminal or an XTerm terminal 
>> - it seemed it
>> didn't know where my HOME directory was.
>>
>> As a result, I set my HOME directory in the environment settings for 
>> my user. Once I
>> did that, I was able to use the Cygwin Terminal and XTerm terminals 
>> again.
>>
>> The only thing that is still not working (as far as I can see) is any 
>> ssh client which
>> needs to find the .ssh directory (like ssh or git, etc.).
>>
> 
> Assuming Cygwin doesn't know about my user (when the PC is at home) - is 
> there something
> I can run to reset what Cygwin thinks is the user?
> 
> Otherwise, I'll try reinstalling Cygwin and see if that helps.
> 
> -- 

check the differences in outputs for

     "mkpasswd -c" and "id"

in the two cases.




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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 12:51     ` Marco Atzeri
@ 2020-04-23 15:25       ` Mark Hansen
  2020-04-23 19:19         ` Marco Atzeri
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Hansen @ 2020-04-23 15:25 UTC (permalink / raw)
  To: cygwin

On 4/23/2020 5:51 AM, Marco Atzeri via Cygwin wrote:
> Am 23.04.2020 um 13:54 schrieb Mark Hansen:
>> On 4/21/2020 2:52 PM, Mark Hansen wrote:
>>> On 4/21/2020 8:33 AM, Mark Hansen wrote:
>>>> I have a Windows 10 laptop, on which I installed Cygwin. I always log 
>>>> into the machine using
>>>> my corporate domain account. When I log into the machine from my 
>>>> office, everything Cygwin
>>>> works fine.
>>>>
>>>> When I log into my laptop from home (which I'm working from home for 
>>>> a while now, due to
>>>> COVID-19), I still log in using my corporate domain account, but 
>>>> Cygwin acts differently.
>>>>
>>>> Here is my user id (from the id command) when I log in from the office:
>>>>
>>>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>>>>
>>>> Here is the same when I've logged in with the machine at home:
>>>>
>>>> uid=1293438(MAN+User(244862)) gid=1293438
>>>>
>>>> (MAN) is the domain.
>>>>
>>>> The actual problem I'm having is that Cygwin tools like ssh, git, 
>>>> etc. can't find my .ssh
>>>> directory. They are looking in "/" rather than my home directory.
>>>>
>>>> I tried copying my .ssh directory from my home to "/" and although it 
>>>> was created, the
>>>> files have the wrong permissions and I'm unable to change them.
>>>>
>>>> Is there something I can tweak to get Cygwin to understand which user 
>>>> I am so the ssh
>>>> stuff can start working again?
>>>>
>>>> Thanks for any help.
>>>>
>>>
>>> To answer a question posed by someone to my private e-mail:
>>>
>>> I didn't have the HOME environment variable set at first. When the PC 
>>> is at my office,
>>> Cygwin worked fine. When I took the PC home and logged in there, I had 
>>> severe Cygwin
>>> issues - I wasn't able to open a Cygwin Terminal or an XTerm terminal 
>>> - it seemed it
>>> didn't know where my HOME directory was.
>>>
>>> As a result, I set my HOME directory in the environment settings for 
>>> my user. Once I
>>> did that, I was able to use the Cygwin Terminal and XTerm terminals 
>>> again.
>>>
>>> The only thing that is still not working (as far as I can see) is any 
>>> ssh client which
>>> needs to find the .ssh directory (like ssh or git, etc.).
>>>
>> 
>> Assuming Cygwin doesn't know about my user (when the PC is at home) - is 
>> there something
>> I can run to reset what Cygwin thinks is the user?
>> 
>> Otherwise, I'll try reinstalling Cygwin and see if that helps.
>> 
>> -- 
> 
> check the differences in outputs for
> 
>       "mkpasswd -c" and "id"
> 
> in the two cases.
> 
> 
> 

I have the differences for 'id' in the two cases. However, I currently don't have access to
my office during the 'stay at home' order we're having to honor these days.

I don't understand the difference in the 'id' output, but they are different. I showed
the first little bit of each in my first message. Does this help? Should I attach the
complete output of the two runs here?


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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-21 15:33 Problems with ssh when I log into my PC using my corporate domain while working from home Mark Hansen
  2020-04-21 21:52 ` Mark Hansen
@ 2020-04-23 17:26 ` ASSI
  2020-04-23 18:10   ` Mark Hansen
  1 sibling, 1 reply; 14+ messages in thread
From: ASSI @ 2020-04-23 17:26 UTC (permalink / raw)
  To: cygwin

Mark Hansen writes:
> Here is my user id (from the id command) when I log in from the office:
>
> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>
> Here is the same when I've logged in with the machine at home:
>
> uid=1293438(MAN+User(244862)) gid=1293438
>
> (MAN) is the domain.

That likely means that when you connect from home, you cannot talk to the
corporate domain server or you are ion a different domain.  The domain
part is only shown when it isn't the primary domain IIRC and since the
numerical user instead of the name is shown, that SID did not resolve.

> The actual problem I'm having is that Cygwin tools like ssh, git, etc. can't find my .ssh
> directory. They are looking in "/" rather than my home directory.

Depending on how this is set up in your domain, you might need to point
either Cygwin or sshd to use a separate local directory.  You have no
network access on Windows (i.e. you won't be able to access any fils
shares) until you've authenticated with a password.

> I tried copying my .ssh directory from my home to "/" and although it was created, the
> files have the wrong permissions and I'm unable to change them.

You would need to be either an admin and/or the user who installed
Cygwin for that to work, but you shouldn't do that.

> Is there something I can tweak to get Cygwin to understand which user I am so the ssh
> stuff can start working again?

If Cygwin doesn't know who you are, then that means Windows doesn't know
either, so fixing this on the Cygwin side won't get you much further.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 17:26 ` ASSI
@ 2020-04-23 18:10   ` Mark Hansen
  2020-04-23 18:57     ` Norton Allen
  2020-04-23 19:33     ` Achim Gratz
  0 siblings, 2 replies; 14+ messages in thread
From: Mark Hansen @ 2020-04-23 18:10 UTC (permalink / raw)
  To: cygwin

On 4/23/2020 10:26 AM, ASSI wrote:
> Mark Hansen writes:
>> Here is my user id (from the id command) when I log in from the office:
>>
>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>>
>> Here is the same when I've logged in with the machine at home:
>>
>> uid=1293438(MAN+User(244862)) gid=1293438
>>
>> (MAN) is the domain.
> 
> That likely means that when you connect from home, you cannot talk to the
> corporate domain server or you are ion a different domain.  The domain
> part is only shown when it isn't the primary domain IIRC and since the
> numerical user instead of the name is shown, that SID did not resolve.
> 
>> The actual problem I'm having is that Cygwin tools like ssh, git, etc. can't find my .ssh
>> directory. They are looking in "/" rather than my home directory.
> 
> Depending on how this is set up in your domain, you might need to point
> either Cygwin or sshd to use a separate local directory.  You have no
> network access on Windows (i.e. you won't be able to access any fils
> shares) until you've authenticated with a password.
> 
>> I tried copying my .ssh directory from my home to "/" and although it was created, the
>> files have the wrong permissions and I'm unable to change them.
> 
> You would need to be either an admin and/or the user who installed
> Cygwin for that to work, but you shouldn't do that.
> 
>> Is there something I can tweak to get Cygwin to understand which user I am so the ssh
>> stuff can start working again?
> 
> If Cygwin doesn't know who you are, then that means Windows doesn't know
> either, so fixing this on the Cygwin side won't get you much further.
> 
> 
> Regards,
> Achim.
> 

I think Windows knows who I am. I log into the machine using my normal domain login
credentials. The machine looks the way it does when I log in when the machine is in the
office - the desktop is the same, etc. - it's not acting like I'm a new user or anything
like that.

Everything on the Windows side seems to be working fine. The only issue I've found is with
Cygwin. Is there a way (short of removing and reinstalling Cygwin) that I can get Cygwin
to recognize my current user so ssh and git can know where my home directory is located?



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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 18:10   ` Mark Hansen
@ 2020-04-23 18:57     ` Norton Allen
  2020-04-24 13:43       ` Mark Hansen
  2020-04-23 19:33     ` Achim Gratz
  1 sibling, 1 reply; 14+ messages in thread
From: Norton Allen @ 2020-04-23 18:57 UTC (permalink / raw)
  To: cygwin; +Cc: Mark Hansen

On 4/23/2020 2:10 PM, Mark Hansen wrote:
> On 4/23/2020 10:26 AM, ASSI wrote:
>> Mark Hansen writes:
>>> Here is my user id (from the id command) when I log in from the office:
>>>
>>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>>>
>>> Here is the same when I've logged in with the machine at home:
>>>
>>> uid=1293438(MAN+User(244862)) gid=1293438
>>>
>>> (MAN) is the domain.
>>
>> That likely means that when you connect from home, you cannot talk to 
>> the
>> corporate domain server or you are ion a different domain.  The domain
>> part is only shown when it isn't the primary domain IIRC and since the
>> numerical user instead of the name is shown, that SID did not resolve.
>>
>>> The actual problem I'm having is that Cygwin tools like ssh, git, 
>>> etc. can't find my .ssh
>>> directory. They are looking in "/" rather than my home directory.
>>
>> Depending on how this is set up in your domain, you might need to point
>> either Cygwin or sshd to use a separate local directory.  You have no
>> network access on Windows (i.e. you won't be able to access any fils
>> shares) until you've authenticated with a password.
>>
>>> I tried copying my .ssh directory from my home to "/" and although 
>>> it was created, the
>>> files have the wrong permissions and I'm unable to change them.
>>
>> You would need to be either an admin and/or the user who installed
>> Cygwin for that to work, but you shouldn't do that.
>>
>>> Is there something I can tweak to get Cygwin to understand which 
>>> user I am so the ssh
>>> stuff can start working again?
>>
>> If Cygwin doesn't know who you are, then that means Windows doesn't know
>> either, so fixing this on the Cygwin side won't get you much further.
>>
>>
>> Regards,
>> Achim.
>>
>
> I think Windows knows who I am. I log into the machine using my normal 
> domain login
> credentials. The machine looks the way it does when I log in when the 
> machine is in the
> office - the desktop is the same, etc. - it's not acting like I'm a 
> new user or anything
> like that.
>
> Everything on the Windows side seems to be working fine. The only 
> issue I've found is with
> Cygwin. Is there a way (short of removing and reinstalling Cygwin) 
> that I can get Cygwin
> to recognize my current user so ssh and git can know where my home 
> directory is located?

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.

-- 

=============================================================
Norton Allen (he/him/his)
Software Engineer
Harvard University School of Engineering and Applied Sciences
12 Oxford St., Link Bldg. (Office 282)
Cambridge, MA  02138
Phone: (617) 998-5553
=============================================================


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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 15:25       ` Mark Hansen
@ 2020-04-23 19:19         ` Marco Atzeri
  2020-04-23 19:30           ` Marco Atzeri
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Atzeri @ 2020-04-23 19:19 UTC (permalink / raw)
  To: cygwin

Am 23.04.2020 um 17:25 schrieb Mark Hansen:
> On 4/23/2020 5:51 AM, Marco Atzeri via Cygwin wrote:
>> Am 23.04.2020 um 13:54 schrieb Mark Hansen:
>>> On 4/21/2020 2:52 PM, Mark Hansen wrote:
>>>> On 4/21/2020 8:33 AM, Mark Hansen wrote:
>>>>> I have a Windows 10 laptop, on which I installed Cygwin. I always 
>>>>> log into the machine using
>>>>> my corporate domain account. When I log into the machine from my 
>>>>> office, everything Cygwin
>>>>> works fine.
>>>>>
>>>>> When I log into my laptop from home (which I'm working from home 
>>>>> for a while now, due to
>>>>> COVID-19), I still log in using my corporate domain account, but 
>>>>> Cygwin acts differently.
>>>>>
>>>>> Here is my user id (from the id command) when I log in from the 
>>>>> office:
>>>>>
>>>>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>>>>>
>>>>> Here is the same when I've logged in with the machine at home:
>>>>>
>>>>> uid=1293438(MAN+User(244862)) gid=1293438
>>>>>
>>>>> (MAN) is the domain.
>>>>>

>>
>> check the differences in outputs for
>>
>>       "mkpasswd -c" and "id"
>>
>> in the two cases.
>>
>>
>>
> 
> I have the differences for 'id' in the two cases. However, I currently 
> don't have access to
> my office during the 'stay at home' order we're having to honor these days.
> 
> I don't understand the difference in the 'id' output, but they are 
> different. I showed
> the first little bit of each in my first message. Does this help? Should 
> I attach the
> complete output of the two runs here?
> 

I would look at any differences in the 4th and 5th field of
  "mkpasswd -c" output


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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 19:19         ` Marco Atzeri
@ 2020-04-23 19:30           ` Marco Atzeri
  2020-04-23 21:50             ` Mark Hansen
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Atzeri @ 2020-04-23 19:30 UTC (permalink / raw)
  To: cygwin



Am 23.04.2020 um 21:19 schrieb Marco Atzeri:
> Am 23.04.2020 um 17:25 schrieb Mark Hansen:
>> On 4/23/2020 5:51 AM, Marco Atzeri via Cygwin wrote:
>>> Am 23.04.2020 um 13:54 schrieb Mark Hansen:
>>>> On 4/21/2020 2:52 PM, Mark Hansen wrote:
>>>>> On 4/21/2020 8:33 AM, Mark Hansen wrote:
>>>>>> I have a Windows 10 laptop, on which I installed Cygwin. I always 
>>>>>> log into the machine using
>>>>>> my corporate domain account. When I log into the machine from my 
>>>>>> office, everything Cygwin
>>>>>> works fine.
>>>>>>
>>>>>> When I log into my laptop from home (which I'm working from home 
>>>>>> for a while now, due to
>>>>>> COVID-19), I still log in using my corporate domain account, but 
>>>>>> Cygwin acts differently.
>>>>>>
>>>>>> Here is my user id (from the id command) when I log in from the 
>>>>>> office:
>>>>>>
>>>>>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>>>>>>
>>>>>> Here is the same when I've logged in with the machine at home:
>>>>>>
>>>>>> uid=1293438(MAN+User(244862)) gid=1293438
>>>>>>
>>>>>> (MAN) is the domain.
>>>>>>
> 
>>>
>>> check the differences in outputs for
>>>
>>>       "mkpasswd -c" and "id"
>>>
>>> in the two cases.
>>>
>>>
>>>
>>
>> I have the differences for 'id' in the two cases. However, I currently 
>> don't have access to
>> my office during the 'stay at home' order we're having to honor these 
>> days.
>>
>> I don't understand the difference in the 'id' output, but they are 
>> different. I showed
>> the first little bit of each in my first message. Does this help? 
>> Should I attach the
>> complete output of the two runs here?
>>
> 
> I would look at any differences in the 4th and 5th field of
>   "mkpasswd -c" output
> 

5th (SID) and 6th (Home)


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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 18:10   ` Mark Hansen
  2020-04-23 18:57     ` Norton Allen
@ 2020-04-23 19:33     ` Achim Gratz
  1 sibling, 0 replies; 14+ messages in thread
From: Achim Gratz @ 2020-04-23 19:33 UTC (permalink / raw)
  To: cygwin

Mark Hansen writes:
> I think Windows knows who I am. I log into the machine using my normal domain login
> credentials. The machine looks the way it does when I log in when the machine is in the
> office - the desktop is the same, etc. - it's not acting like I'm a new user or anything
> like that.

That doesn't necessarily tell you anything about what happens when you
try to log in via ssh (which creates a new session and requires an
independent login).  Again, the fact that Cygwin shows you a different
user name already tells you that there is something quite different from
when you are in the office.  If you can strace id you might get a clue
of what is going on with the queries to the AD sever in both cases
(i.e. what server it asks and whether it gets an answer).

> Everything on the Windows side seems to be working fine. The only issue I've found is with
> Cygwin. Is there a way (short of removing and reinstalling Cygwin) that I can get Cygwin
> to recognize my current user so ssh and git can know where my home directory is located?

Yes, you can force a home directory via config files, but you should
keep in mind that this can fail in even more mysterious ways should the
environment change again.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 19:30           ` Marco Atzeri
@ 2020-04-23 21:50             ` Mark Hansen
  2020-04-24  5:11               ` Brian Inglis
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Hansen @ 2020-04-23 21:50 UTC (permalink / raw)
  To: cygwin

On 4/23/2020 12:30 PM, Marco Atzeri via Cygwin wrote:
> 
> 
> Am 23.04.2020 um 21:19 schrieb Marco Atzeri:
>> Am 23.04.2020 um 17:25 schrieb Mark Hansen:
>>> On 4/23/2020 5:51 AM, Marco Atzeri via Cygwin wrote:
>>>> Am 23.04.2020 um 13:54 schrieb Mark Hansen:
>>>>> On 4/21/2020 2:52 PM, Mark Hansen wrote:
>>>>>> On 4/21/2020 8:33 AM, Mark Hansen wrote:
>>>>>>> I have a Windows 10 laptop, on which I installed Cygwin. I always 
>>>>>>> log into the machine using
>>>>>>> my corporate domain account. When I log into the machine from my 
>>>>>>> office, everything Cygwin
>>>>>>> works fine.
>>>>>>>
>>>>>>> When I log into my laptop from home (which I'm working from home 
>>>>>>> for a while now, due to
>>>>>>> COVID-19), I still log in using my corporate domain account, but 
>>>>>>> Cygwin acts differently.
>>>>>>>
>>>>>>> Here is my user id (from the id command) when I log in from the 
>>>>>>> office:
>>>>>>>
>>>>>>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>>>>>>>
>>>>>>> Here is the same when I've logged in with the machine at home:
>>>>>>>
>>>>>>> uid=1293438(MAN+User(244862)) gid=1293438
>>>>>>>
>>>>>>> (MAN) is the domain.
>>>>>>>
>> 
>>>>
>>>> check the differences in outputs for
>>>>
>>>>       "mkpasswd -c" and "id"
>>>>
>>>> in the two cases.
>>>>
>>>>
>>>>
>>>
>>> I have the differences for 'id' in the two cases. However, I currently 
>>> don't have access to
>>> my office during the 'stay at home' order we're having to honor these 
>>> days.
>>>
>>> I don't understand the difference in the 'id' output, but they are 
>>> different. I showed
>>> the first little bit of each in my first message. Does this help? 
>>> Should I attach the
>>> complete output of the two runs here?
>>>
>> 
>> I would look at any differences in the 4th and 5th field of
>>   "mkpasswd -c" output
>> 
> 
> 5th (SID) and 6th (Home)
> 

Here is my mkpasswd -c output while the machine is at home (I can't run it at the office,
as I'm not allowed to go there at this time):

Mark.Hansen:*:1293438:1049089:U-MAN\Mark.Hansen,S-1-5-21-602162358-1060284298-725345543-244862:/cygdrive/c/Users/mark.hansen:/bin/zsh

Note that my domain is "MAN" not "U-MAN" - I don't know if that is significant.
This does show my home directory as /cygdrive/c/Users/mark.hansen, which is correct.




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

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 21:50             ` Mark Hansen
@ 2020-04-24  5:11               ` Brian Inglis
  0 siblings, 0 replies; 14+ messages in thread
From: Brian Inglis @ 2020-04-24  5:11 UTC (permalink / raw)
  To: cygwin

On 2020-04-23 15:50, Mark Hansen wrote:
> On 4/23/2020 12:30 PM, Marco Atzeri via Cygwin wrote:
>> Am 23.04.2020 um 21:19 schrieb Marco Atzeri:
>>> Am 23.04.2020 um 17:25 schrieb Mark Hansen:
>>>> On 4/23/2020 5:51 AM, Marco Atzeri via Cygwin wrote:
>>>>> Am 23.04.2020 um 13:54 schrieb Mark Hansen:
>>>>>> On 4/21/2020 2:52 PM, Mark Hansen wrote:
>>>>>>> On 4/21/2020 8:33 AM, Mark Hansen wrote:
>>>>>>>> I have a Windows 10 laptop, on which I installed Cygwin. I always log
>>>>>>>> into the machine using
>>>>>>>> my corporate domain account. When I log into the machine from my office,
>>>>>>>> everything Cygwin
>>>>>>>> works fine.
>>>>>>>> When I log into my laptop from home (which I'm working from home for a
>>>>>>>> while now, due to
>>>>>>>> COVID-19), I still log in using my corporate domain account, but Cygwin
>>>>>>>> acts differently.
>>>>>>>> Here is my user id (from the id command) when I log in from the office:
>>>>>>>> uid=1293438(Mark.Hansen) gid=1049089(Domain Users) ...
>>>>>>>> Here is the same when I've logged in with the machine at home:
>>>>>>>> uid=1293438(MAN+User(244862)) gid=1293438
>>>>>>>> (MAN) is the domain.

>>>>> check the differences in outputs for
>>>>>       "mkpasswd -c" and "id"
>>>>> in the two cases.

>>>> I have the differences for 'id' in the two cases. However, I currently
>>>> don't have access to my office during the 'stay at home' order we're
>>>> having to honor these days.
>>>> I don't understand the difference in the 'id' output, but they are 
>>>> different. I showed the first little bit of each in my first message.
>>>> Does this help? Should I attach the complete output of the two runs
>>>> here?

>>> I would look at any differences in the 4th and 5th field of
>>>   "mkpasswd -c" output

>> 5th (SID) and 6th (Home)

> Here is my mkpasswd -c output while the machine is at home (I can't run it
> at the office, as I'm not allowed to go there at this time):
> Mark.Hansen:*:1293438:1049089:U-MAN\Mark.Hansen,
> S-1-5-21-602162358-1060284298-725345543-244862
> :/cygdrive/c/Users/mark.hansen:/bin/zsh
> Note that my domain is "MAN" not "U-MAN" - I don't know if that is
> significant. This does show my home directory as
> /cygdrive/c/Users/mark.hansen, which is correct.

Try:

$ getent passwd $USER

as I believe getent uses the /etc/nsswitch.conf settings while mkpasswd may not:
they often produce different lists or entries when I run them.

Not sure if it still applies, although it is still suggested in the docs:
install and run the cygserver service, then use passwd -R to stash your password
in the registry to allow network access.

-- 
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] 14+ messages in thread

* Re: Problems with ssh when I log into my PC using my corporate domain while working from home
  2020-04-23 18:57     ` Norton Allen
@ 2020-04-24 13:43       ` Mark Hansen
  0 siblings, 0 replies; 14+ messages in thread
From: Mark Hansen @ 2020-04-24 13:43 UTC (permalink / raw)
  To: cygwin

On 4/23/2020 11:57 AM, Norton Allen wrote:

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


This solved the issue for me. After doing what was suggested, above, I killed all the
Cygwin processes (actually, I rebooted the machine) and now when I try to perform
commands like ssh and git (which need to access files in my .ssh directory) they
are able to find the files and therefore are working again.

I realize that when I am able to once again work from my office, I may need to undo
these changes, but I'm quite happy that at least for now, it's working again.

Thanks to all who helped with this!

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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 15:33 Problems with ssh when I log into my PC using my corporate domain while working from home Mark Hansen
2020-04-21 21:52 ` Mark Hansen
2020-04-23 11:54   ` Mark Hansen
2020-04-23 12:51     ` Marco Atzeri
2020-04-23 15:25       ` Mark Hansen
2020-04-23 19:19         ` Marco Atzeri
2020-04-23 19:30           ` Marco Atzeri
2020-04-23 21:50             ` Mark Hansen
2020-04-24  5:11               ` Brian Inglis
2020-04-23 17:26 ` ASSI
2020-04-23 18:10   ` Mark Hansen
2020-04-23 18:57     ` Norton Allen
2020-04-24 13:43       ` Mark Hansen
2020-04-23 19:33     ` Achim Gratz

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