Follow

This seems weird: when I SSH into a newer MacOS from my workstation, what home directory my user is assigned varies by which Windows shell (or perhaps SSH implementation) I'm using to get there.

cmd (I assume using Microsoft's SSH): /var/empty

Cygwin: /Users/[username]

The environment (i.e. what you see when you type "set") is quite different as well. Very strange.

Β· Β· 1 Β· 0 Β· 2

@dredmorbius Implementation maybe. They both have the same configuration.

The only other possible difference is that WinSSH is v7.7 while Cygwin's is 8.3.

@dredmorbius I think I've got it figured out: it's something to do with how MacOS interacts with Active Directory.

From cmd: 'ssh [domain\userid]@[host]' gives me a home directory of /var/empty, just as 'ssh [host]' does.

'ssh [userid]@[host]' gives me the correct home directory of /Users/[userid].

Cygwin must not bother with trying to auth against AD unless explicitly told to.

@dredmorbius If I have Cygwin SSH login as '[domain\\userid]@[host]' it'll give me /var/empty again.

We shouldn't be using AD with MacOS as we do anyway; it's supposed to work better if you tell the Mac it's a local user account and then have a shim like NoMAD talk to AD on its behalf.

@bthylafh You should be able to exlplicitly specify the remote user in your SSH client config.

Though I'm kind if confused why that's not already happening.

@dredmorbius I could try that. Thing is that I'm using Microsoft's sshd on my Windows machines to replace 'psexec \\[host] cmd', so that might break.

Not a huge deal to me since I have icons for Cygwin bash and the Windows command prompt in my Taskbar anyway.

@bthylafh I suspect Cygwin may be usin g "username" and Microsoft username@[AD_Domain]. MacOS may know the domain but doesn't have a local user dir.

Specify the remte username explicitly for consistent behaviour.

Check remote UID for each method. I suspect they differ.

@dredmorbius Explicitly setting username for all hosts in %USERPROFILE%\.ssh\config does the job, thanks.

Sign in to participate in the conversation
Mastodon πŸ” privacytools.io

Fast, secure and up-to-date instance. PrivacyTools provides knowledge and tools to protect your privacy against global mass surveillance.

Website: privacytools.io
Matrix Chat: chat.privacytools.io
Support us on OpenCollective, many contributions are tax deductible!