Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH Authentication Fails from Linux to Windows Box #543

Closed
milindbangar79 opened this issue Feb 24, 2017 · 11 comments
Closed

SSH Authentication Fails from Linux to Windows Box #543

milindbangar79 opened this issue Feb 24, 2017 · 11 comments

Comments

@milindbangar79
Copy link

milindbangar79 commented Feb 24, 2017

Hi,

Our scenario

  • Trying to connect from Linux to a Windows box (SSH server). The boxes are in different domains.(from us.xxx.com (Linux Server) to inet.xxx.local domain (Windows Server))
  • We have tested connectivity within the same domain and it works fine.
  • Using V0.8.0 of OpenSSH

Attaching the Debug log for your reference:

6564 16:25:07 799 debug1: userauth-request for user svcpltadmindev@us service ssh-connection method none
6564 16:25:07 799 debug1: attempt 0 failures 0
6564 16:25:07 799 debug2: parse_server_config: config reprocess config len 323
6564 16:25:10 065 debug1: NetUserGetInfo() failed with error: 1722 \n
6564 16:25:10 471 debug1: NetUserGetInfo() with domainController failed with error: 5 \n

9072 16:25:10 596 debug2: ReadCB pio:000000975402CA00, pending_state:1, error:109, received:0
9072 16:25:10 596 debug3: select - returning 1
9072 16:25:10 596 debug1: close - io:000000975402CA00, type:2, fd:6, table_index:6
9072 16:25:10 596 debug2: fileclose - pio:000000975402CA00
9072 16:25:10 596 debug3: w32_select fd:3
9072 16:25:10 596 debug3: w32_select fd:4
9072 16:25:10 596 debug3: Total in fds:2
9072 16:25:10 596 debug2: on_select - io:000000975402D0E0 type:1 rd:1
9072 16:25:10 596 debug2: on_select - io:000000975402C7F0 type:1 rd:1
9072 16:25:10 596 debug3: wait() on 0 events and 1 children
9072 16:25:10 596 debug1: zombie'ing child at index 0, 0 zombies of 1
9072 16:25:10 596 debug3: process_signals()
9072 16:25:10 596 debug1: raise sig:3
9072 16:25:10 596 debug3: waitpid - pid:-1, options:1
9072 16:25:10 596 debug1: Unregister child at index 0, 1 zombies of 1
9072 16:25:10 596 debug3: waitpid - pid:-1, options:1
9072 16:25:10 596 debug2: signal() sig:3, handler:00007FF756B4C4F0
9072 16:25:10 596 debug1: process_queued_signals: WARNING - A signal has interrupted and was processed
9072 16:25:10 596 debug3: w32_select fd:3
9072 16:25:10 596 debug3: w32_select fd:4
9072 16:25:10 596 debug3: Total in fds:2
9072 16:25:10 596 debug2: on_select - io:000000975402D0E0 type:1 rd:1
9072 16:25:10 596 debug2: on_select - io:000000975402C7F0 type:1 rd:1
9072 16:25:10 596 debug3: wait() on 0 events and 0 children
9072 16:25:10 596 debug3: wait() on 2 events and 0 children

Early help is much appreciated.

Regards
Milind

@bagajjal
Copy link
Collaborator

This error occurs when the sshd process is unable to retrieve the user information...

I will test at my end and update this thread..

@manojampalam
Copy link
Contributor

Can you try providing full FQDN in user name i.e [email protected] ?

@milindbangar79
Copy link
Author

milindbangar79 commented Feb 27, 2017

Tried the following FQDN :

  1. svcpltadmindev@us.xxx.com@winbox
  2. 'us\svcpltadmindev'@winBox
  3. 'us.xxx.com\svcpltadmindev'@winBox

No luck.

Hope that's what you were looking for..

We have configured in another windows box and trying and getting the following

Invalid user us.xxx.com\dadmmbangar from 10.36.18.100 port 59584

I am able to RDP the Windows server, but not able to connect via ssh. User profile is available on the Windows server.

The user we are testing against is a domain user.

Query : Is there any limitation for cross domain ssh based authentication, which should be taken care during installation?

@gd197
Copy link

gd197 commented Mar 1, 2017

we had to escape the \ for interactive domain access from a linux box
ssh domain\\user@winbox
Hope that helps
EDIT.

@manojampalam
Copy link
Contributor

manojampalam commented Mar 1, 2017

Somehow the following logic in pwd.c is failing:
if ((status = NetUserGetInfo(udom_utf16, uname_utf16, 23, &user_info)) != NERR_Success) {
debug("NetUserGetInfo() failed with error: %d for user: %ls and domain: %ls \n", status, uname_utf16, udom_utf16);

		if ((dsStatus = DsGetDcNameW(NULL, udom_utf16, NULL, NULL, DS_DIRECTORY_SERVICE_PREFERRED, &pdc)) != ERROR_SUCCESS) {
			error("DsGetDcNameW() failed with error: %d \n", dsStatus);
			errno = ENOENT;
			goto done;
		}

		if ((status = NetUserGetInfo(pdc->DomainControllerName, uname_utf16, 23, &user_info)) != NERR_Success) {
			debug("NetUserGetInfo() with domainController: %ls failed with error: %d \n", pdc->DomainControllerName, status);
			errno = ENOENT;
			goto done;
		}

Can you try running sshd in debug mode

  • net stop sshd
  • In an elevated cmd.exe, run sshd.exe -d

and see if you can get past this error? (It may fail due to other reasons down the line, but we want to check if we are able to retrieve user's SID

Also try running sshd as SYSTEM and see if it makes a difference:
sc.exe config sshd obj= LocalSystem
restart sshd

@jschvartz
Copy link

Hi,
Maybe my issue is related to this one:

  • WIN10 host with openssd sshd daemon (for tests purpose, will be using on WIN2008 or WIN2012 Servers)
  • RHEL 6 ssh client
  • Both in the same AD domain
    "ssh user@domain@host command" works ok, but cannot access Domain shares.
    I noticed this in debug output;
    [NetUserGetInfo() failed with error: 1722 for user]
    I attached the entire debug output of a sigle command.

Thanks for your work.
Joel
sshd.debug.txt

@manojampalam
Copy link
Contributor

You cannot access domain shares because of this - #518

@jschvartz
Copy link

jschvartz commented Mar 3, 2017 via email

@manojampalam
Copy link
Contributor

accessing a share (domain or not) involves authentication. Remote ssh sessions created using key based auth cannot do outbound authentication, hence cannot access any share.

@jschvartz
Copy link

jschvartz commented Mar 6, 2017 via email

@manojampalam
Copy link
Contributor

Please continue double hop related discussion in #518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants