ReproNim / reproman

ReproMan (AKA NICEMAN, AKA ReproNim TRD3)
https://reproman.readthedocs.io
Other
24 stars 14 forks source link

Password login fallback does not work #606

Open asmacdo opened 1 year ago

asmacdo commented 1 year ago

Summary

When creating an ssh resource for Dartmouth's Discovery cluster, (which does not accept ssh-keys) there is no password parameter. However, the code looks like it is supposed to try a password if there is an AuthenticationException:

https://github.com/ReproNim/reproman/blob/master/reproman/resource/ssh.py#L112

Reproducer

reproman create -t ssh discovery -b user=myusername -b host=discovery.dartmouth.edu

Actual Result However, with discovery, there is no such AuthenticationException. Instead we get a socket.gaierror: (-2, 'Name or service not known')

Option 1

We could s/AuthenticationException/Exception/ to make the fallback work, but this is not ideal. Many clusters are set up to block users who attempt and fail to login a certain number of times.

Option 2

IMO the better solution would be to add a password backend-parameter to the resources.ssh

@yarikoptic wdyt?

asmacdo commented 1 year ago

Also, while I think passing a password should work, it would be better to encourage users to authenticate with gssapi because the password used here should be treated very carefully.