Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-334

Unable to login on Linode instances with driver generated password


    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13.0
    • Component/s: Compute
    • Labels:



      When creating instances with Debian 7 images on Linode provider, I was unable to login using generated password, I review API calls and seems ok to me, so I opened a ticket with Linode support team.

      This is the response from support:

      == start here ==

      I have determined the source of the issue you are experiencing. If you decode the encoded string you're sending for the root password, you'll notice that there is actually a newline (%0A) on the end of it:

      >>> import urllib
      >>> urllib2.unquote('bPJ%2FY%2BTy%2FCU%3D%0A')

      If you take that string and test it with crypt, you'll see that it does in fact match if the newline is included:

      >>> import crypt
      >>> crypt.crypt('bPJ/Y+Ty/CU=', '$1$e5348d91$X/u/q7slmZPgFioKx0aFm.')
      >>> crypt.crypt('bPJ/Y+Ty/CU=\n', '$1$e5348d91$X/u/q7slmZPgFioKx0aFm.')

      As you can see, the newline on the end of the password is included in the hash and a normal login session doesn't capture a newline as part of the password. The quick fix is to strip the newline off before encoding the password to send in the URL, like so:

      root = binascii.b2a_base64(os.urandom(8)).decode('ascii').strip()

      Making that change should fix your ability to log in using a password after deploying a new Linode. Let us know if you need further assistance.

      == ends here ==

      Tested and worked!. Just adding newline strip on root password generator.

      Hope that helps
      Juan Carlos Moreno




            • Assignee:
              kami Tomaz Muraus
              juancarlos.moreno@ackstorm.es Juan Carlos Moreno
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: