Skip to content

FISH-13913 SSH Nodes - Convert schtasks to password logon - #8309

Open
kalinchan wants to merge 4 commits into
payara:mainfrom
kalinchan:FISH-13913
Open

FISH-13913 SSH Nodes - Convert schtasks to password logon#8309
kalinchan wants to merge 4 commits into
payara:mainfrom
kalinchan:FISH-13913

Conversation

@kalinchan

Copy link
Copy Markdown
Member

Description

This PR changes the behaviour of Windows SSH Nodes by changing the way instances are launched to use schtasks with the password logon type.

This requires a user to specify the Windows SSH User password via a passwordfile when creating the SSH Node (AS_ADMIN_SSHPASSWORD={SSH_USER_PASSWORD})

For a non admin user on Windows, the following permission is also required SeBatchLogonRight

This also fixes an issue with the isBehindProxyEnabled method as SSH Nodes do not have the server element.

Important Info

Blockers

n/a

Testing

New tests

Will make another PR

Testing Performed

Manual tested windows and linux nodes both non admin and admin users.

Testing Environment

Windows, Linux, MacOS

Documentation

Pending

Notes for Reviewers

Ensure that non admin windows users have the SeBatchLogonRight permission and the ssh password is specified for the node.

Also ensure that the required firewall ports are opened

@Pandrex247 Pandrex247 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't seem to be able to connect any more.

I get the following errors when attempting to connect and install Payara Server using a password (not a key file). I've tested direct SSH access via password and that works fine.

[#|2026-08-10T10:31:35.029+0100|INFO|Payara 7.2026.8|org.apache.sshd.client.config.hosts.DefaultConfigFileHostEntryResolver|_ThreadID=273;_ThreadName=admin-thread-pool::admin-listener(5);_TimeMillis=1786354295029;_LevelValue=800;|
  resolveEffectiveResolver(sshtest@192.168.50.208:22/null) no configuration file at C:\Users\andrew.pielage\.ssh\config|#]

[#|2026-08-10T10:31:35.237+0100|WARNING|Payara 7.2026.8|javax.enterprise.system.core|_ThreadID=273;_ThreadName=admin-thread-pool::admin-listener(5);_TimeMillis=1786354295237;_LevelValue=900;|
  SSH auth with key file C:\Users\andrew.pielage\.ssh\id_rsa failed: No more authentication methods available
org.apache.sshd.common.SshException: No more authentication methods available
        at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:141)
        at org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:56)
        at org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:35)
        at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:121)
        at org.glassfish.cluster.ssh.launcher.SSHLauncher.tryKeyFileAuth(SSHLauncher.java:358)
        at org.glassfish.cluster.ssh.launcher.SSHLauncher.openSession(SSHLauncher.java:286)
        at org.glassfish.cluster.ssh.launcher.SSHLauncher.getSFTPClient(SSHLauncher.java:548)
...
Caused by: org.apache.sshd.common.SshException: No more authentication methods available
        at org.apache.sshd.client.session.ClientUserAuthService.tryNext(ClientUserAuthService.java:441)
        at org.apache.sshd.client.session.ClientUserAuthService.processUserAuth(ClientUserAuthService.java:375)
        at org.apache.sshd.client.session.ClientUserAuthService.process(ClientUserAuthService.java:270)
        at org.apache.sshd.common.session.helpers.CurrentService.process(CurrentService.java:109)
...
[#|2026-08-10T10:31:35.267+0100|WARNING|Payara 7.2026.8|javax.enterprise.system.core|_ThreadID=273;_ThreadName=admin-thread-pool::admin-listener(5);_TimeMillis=1786354295267;_LevelValue=900;|
  SSH auth with password failed: Too many authentication failures
org.apache.sshd.common.SshException: Too many authentication failures
        at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:141)
        at org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:56)
        at org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:35)
        at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:121)
...
Caused by: org.apache.sshd.common.SshException: Too many authentication failures
        at org.apache.sshd.client.session.ClientSessionImpl.handleDisconnect(ClientSessionImpl.java:175)
        at org.apache.sshd.common.session.helpers.SessionHelper.handleDisconnect(SessionHelper.java:1241)
        at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:586)

...

[#|2026-08-10T10:31:35.277+0100|WARNING|Payara 7.2026.8|javax.enterprise.system.core|_ThreadID=273;_ThreadName=admin-thread-pool::admin-listener(5);_TimeMillis=1786354295277;_LevelValue=900;|
  Could not connect to host 192.168.50.208 using SSH.: Could not authenticate to 192.168.50.208. SSH auth with key file C:\Users\andrew.pielage\.ssh\id_rsa failed: No more authentication methods available
SSH auth with password failed: Too many authentication failures
: host=192.168.50.208 port=22 user=sshtest password=<concealed> keyFile=C:\Users\andrew.pielage\.ssh\id_rsa keyPassPhrase=null knownHostFile=C:\Users\andrew.pielage\.ssh\known_hosts|#]

[#|2026-08-10T10:31:35.282+0100|SEVERE|Payara 7.2026.8|org.glassfish.admingui|_ThreadID=274;_ThreadName=admin-thread-pool::admin-listener(6);_TimeMillis=1786354295282;_LevelValue=1000;|
  updateEntity failed.  parent='http://localhost:4848/management/domain/nodes/create-node-ssh'; attrs ='{sshport=22, nodehost=192.168.50.208, sshpassword=Testyr00, install=true, installdir=C:\Users\sshtest\Downloads\payara7, sshuser=sshtest, id=Main-Test}'
{"message":"Warning: some parameters appear to be invalid.\r\nSSH node not created. To force creation of the node with these parameters rerun the command using the --force option.\r\nCould not connect to host 192.168.50.208 using SSH.\r\nCould not authenticate to 192.168.50.208. SSH auth with key file C:\\Users\\andrew.pielage\\.ssh\\id_rsa failed: No more authentication methods available\nSSH auth with password failed: Too many authentication failures\n","command":"create-node-ssh AdminCommand","exit_code":"FAILURE","extraProperties":{"commandLog":["create-node-ssh --sshport 22 --nodehost 192.168.50.208 --sshpassword Testyr00 --install true --installdir C:\\Users\\sshtest\\Downloads\\payara7 --sshuser sshtest --DEFAULT Main-Test --name Main-Test"],"methods":[{"name":"GET"},{"messageParameters":{"archive":{"acceptableValues":"","defaultValue":"","optional":"true","type":"string"},"force":{"acceptableValues":"","defaultValue":"false","optional":"true","type":"boolean"},"id":{"acceptableValues":"","defaultValue":"","optional":"false","type":"string"},"install":{"acceptableValues":"","defaultValue":"false","optional":"true","type":"boolean"},"installdir":{"acceptableValues":"","defaultValue":"${com.sun.aas.productRoot}","optional":"true","type":"string"},"nodedir":{"acceptableValues":"","defaultValue":"","optional":"true","type":"string"},"nodehost":{"acceptableValues":"","defaultValue":"","optional":"false","type":"string"},"sshkeyfile":{"acceptableValues":"","defaultValue":"","optional":"true","type":"string"},"sshkeypassphrase":{"acceptableValues":"","defaultValue":"","optional":"true","type":"string"},"sshpassword":{"acceptableValues":"","defaultValue":"","optional":"true","type":"string"},"sshport":{"acceptableValues":"","defaultValue":"22","optional":"true","type":"string"},"sshuser":{"acceptableValues":"","defaultValue":"${user.name}","optional":"true","type":"string"}},"name":"POST"}]}}|#]


...


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants