Hi!

I want to write a basic function to check whether root login is enabled
or not.


On the terminal (OpenSSH 8.3p1-1) it looks like this:


If disabled:

```

$ ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no
r...@disabled.com

r...@disabled.com: Permission denied (publickey).
```

If enabled:

```

$ ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no
r...@enabled.com

r...@enabled.com's password:

```


I thought i can get a similar message with /golang.org/x/crypto/ssh/
using /Dial()/'s example code and /Auth/ set to /Password/ only, but the
only message i get is

/"unable to authenticate, attempted methods [none], no supported methods
remain/" with both enabled and disabled root.


How can i get a similar message as OpenSSH's?


Thanks,

    Daniel


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/206ad267-5f87-a553-c54b-731307aefd6a%40danielgorbe.com.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to