You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Tomaz Muraus (JIRA)" <ji...@apache.org> on 2013/09/05 12:28:51 UTC

[jira] [Updated] (LIBCLOUD-334) Unable to login on Linode instances with driver generated password

     [ https://issues.apache.org/jira/browse/LIBCLOUD-334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tomaz Muraus updated LIBCLOUD-334:
----------------------------------

    Fix Version/s: 0.13.0
    
> Unable to login on Linode instances with driver generated password
> ------------------------------------------------------------------
>
>                 Key: LIBCLOUD-334
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-334
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Compute
>            Reporter: Juan Carlos Moreno
>            Assignee: Tomaz Muraus
>            Priority: Critical
>             Fix For: 0.13.0
>
>
> Hi,
> 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')
>     'bPJ/Y+Ty/CU=\n'
> 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.')
>     '$1$e5348d91$s4hfTTBRN31kfxDYbC5bF0'
>     >>> crypt.crypt('bPJ/Y+Ty/CU=\n', '$1$e5348d91$X/u/q7slmZPgFioKx0aFm.')
>     '$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
> Regards
> Juan Carlos Moreno

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira