Score:0

Can not login to server by password set in user_data

sg flag

When I create server by api and set the user_data, the server is created successfully without any errors. However, I have incorrect login. The user_data is generated like below in php.

base64_encode('#cloud-config\npassword: 123456\nchpasswd: { expire: False }\nssh_pwauth: True');

The generated code is something like below:

I2Nsb3VkLWNvbmZpZ1xucGFzc3dvcmQ6IDEyMzQ1NlxuY2hwYXNzd2Q6IHsgZXhwaXJlOiBGYWxzZSB9XG5zc2hfcHdhdXRoOiBUcnVl

when I create a server with the script (without encoding) in horizon, it works. What should I do? I find out that I should write the script like below. However, I do not know what I should write to set password.

#!/bin/bash
/bin/su
echo "I am in you!"
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.