0

Bit new in ssh and have an issue in understanding. I got a code which uses ssh_auth_list routine as below.

method = ssh_auth_list(session);
printf(" %d " , method);

I am using a ssh library and when I am calling this routine.I am seeing return value 20 for some linux servers and 38 for others. As this is a .lib only. I can not see the code inside so that i could relate.

when the value is 38 it ssh looks working and able to connect but when it is 20 it is not able to move into the code further as below are some written lines

#define SSH_AUTH_METHOD_UNKNOWN 0
#define SSH_AUTH_METHOD_NONE 0x0001
#define SSH_AUTH_METHOD_PASSWORD 0x0002
#define SSH_AUTH_METHOD_PUBLICKEY 0x0004
#define SSH_AUTH_METHOD_HOSTBASED 0x0008
#define SSH_AUTH_METHOD_INTERACTIVE 0x0010
#define SSH_AUTH_METHOD_GSSAPI_MIC 0x0020

if ((method & SSH_AUTH_METHOD_PUBLICKEY) && pass_less_ssh) {
      LogENtry(3,"authenticate: trying to authenticate with public key");
else if ((method & SSH_AUTH_METHOD_PASSWORD) && (!pass_less_ssh)) {
      LogENtry(3,"authenticate: trying to authenticate with auth passwd");

What are the different methods could be or what are the dependable factors for this routine in ssh library? Code is running from a window machine

Any link for information or video link to understand the concept also very appreciated.

schroeder
  • 123,438
  • 55
  • 284
  • 319
  • Would be good if you had more code to share so we can see the full concept. From what i gather the script scans for local(or external, on particular subnet/IP range?) online SSH. It either returns a value of 38 or 20 for each server. We do not know what those values represent? They're not ports.. not password length.. any clue? How do you login to those SSH, are they open with no security, do you have a shared public key ? Looks like the servers wich return 20 give SSH_AUTH_METHOD_UNKNOWN, you're running windows, but what are the machines running? – I'm a TI calculator Sep 22 '19 at 18:42
  • I am using libssh library and this is a standard function written in legacy.h as below LIBSSH_API int ssh_auth_list(ssh_session session); with no routine description what it is returning. this is my question as well that what these values represents. I did not get your one question "What are the machine running ?" means ? – Mohit Chauhan Sep 23 '19 at 00:56

0 Answers0