How to set a password for Ubuntu Cloud Images (ie. NOT use ssh)
I'm running an OpenStack cloud with a very particular network configuration, that makes it impossible for an instance to communicate with anything in the outside world until after I login into it and set several config files.
As a result of this, I cannot log in to instances using SSH keys. Is there a way to set a default password on an Ubuntu 12.04 (has to be 12.04) cloud image so I can log in to it directly from the Horizon console? I tried using the procedure outlined at https://ask.openstack.org/en/question/5531/defining-default-user-password-for-ubuntu-cloud-image/ but it did not work on Ubuntu 12.04... it did work on 14.04 though.
password cloud
add a comment |
I'm running an OpenStack cloud with a very particular network configuration, that makes it impossible for an instance to communicate with anything in the outside world until after I login into it and set several config files.
As a result of this, I cannot log in to instances using SSH keys. Is there a way to set a default password on an Ubuntu 12.04 (has to be 12.04) cloud image so I can log in to it directly from the Horizon console? I tried using the procedure outlined at https://ask.openstack.org/en/question/5531/defining-default-user-password-for-ubuntu-cloud-image/ but it did not work on Ubuntu 12.04... it did work on 14.04 though.
password cloud
add a comment |
I'm running an OpenStack cloud with a very particular network configuration, that makes it impossible for an instance to communicate with anything in the outside world until after I login into it and set several config files.
As a result of this, I cannot log in to instances using SSH keys. Is there a way to set a default password on an Ubuntu 12.04 (has to be 12.04) cloud image so I can log in to it directly from the Horizon console? I tried using the procedure outlined at https://ask.openstack.org/en/question/5531/defining-default-user-password-for-ubuntu-cloud-image/ but it did not work on Ubuntu 12.04... it did work on 14.04 though.
password cloud
I'm running an OpenStack cloud with a very particular network configuration, that makes it impossible for an instance to communicate with anything in the outside world until after I login into it and set several config files.
As a result of this, I cannot log in to instances using SSH keys. Is there a way to set a default password on an Ubuntu 12.04 (has to be 12.04) cloud image so I can log in to it directly from the Horizon console? I tried using the procedure outlined at https://ask.openstack.org/en/question/5531/defining-default-user-password-for-ubuntu-cloud-image/ but it did not work on Ubuntu 12.04... it did work on 14.04 though.
password cloud
password cloud
edited Apr 6 '18 at 5:32
meshy
1277
1277
asked Aug 5 '14 at 20:29
user1072692user1072692
13315
13315
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.
then import the keypair into your openstack.
upload this virtual machine image
create a instance(A) from this image
create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected
open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A
after logged in, you can set up the environment for instance B & change the configuration
add a comment |
18.04 setup step-by-step
In short you need:
sudo apt-get install cloud-image-utils
cat >user-data <<EOF
#cloud-config
password: asdfqwer
chpasswd: { expire: False }
ssh_pwauth: True
EOF
cloud-localds user-data.img user-data
# user-data.img MUST come after the rootfs.
qemu-system-x86_64
-drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
-drive file=user-data.img,format=raw
...
and now you can login with:
- username:
ubuntu
- password:
asdfqwer
The user-data.img
drive must be the second one after the first input image.
Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f507345%2fhow-to-set-a-password-for-ubuntu-cloud-images-ie-not-use-ssh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.
then import the keypair into your openstack.
upload this virtual machine image
create a instance(A) from this image
create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected
open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A
after logged in, you can set up the environment for instance B & change the configuration
add a comment |
You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.
then import the keypair into your openstack.
upload this virtual machine image
create a instance(A) from this image
create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected
open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A
after logged in, you can set up the environment for instance B & change the configuration
add a comment |
You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.
then import the keypair into your openstack.
upload this virtual machine image
create a instance(A) from this image
create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected
open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A
after logged in, you can set up the environment for instance B & change the configuration
You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.
then import the keypair into your openstack.
upload this virtual machine image
create a instance(A) from this image
create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected
open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A
after logged in, you can set up the environment for instance B & change the configuration
edited Aug 12 '14 at 6:22
Akiva
4,692134397
4,692134397
answered Aug 12 '14 at 6:13
hgfeaonhgfeaon
111
111
add a comment |
add a comment |
18.04 setup step-by-step
In short you need:
sudo apt-get install cloud-image-utils
cat >user-data <<EOF
#cloud-config
password: asdfqwer
chpasswd: { expire: False }
ssh_pwauth: True
EOF
cloud-localds user-data.img user-data
# user-data.img MUST come after the rootfs.
qemu-system-x86_64
-drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
-drive file=user-data.img,format=raw
...
and now you can login with:
- username:
ubuntu
- password:
asdfqwer
The user-data.img
drive must be the second one after the first input image.
Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?
add a comment |
18.04 setup step-by-step
In short you need:
sudo apt-get install cloud-image-utils
cat >user-data <<EOF
#cloud-config
password: asdfqwer
chpasswd: { expire: False }
ssh_pwauth: True
EOF
cloud-localds user-data.img user-data
# user-data.img MUST come after the rootfs.
qemu-system-x86_64
-drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
-drive file=user-data.img,format=raw
...
and now you can login with:
- username:
ubuntu
- password:
asdfqwer
The user-data.img
drive must be the second one after the first input image.
Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?
add a comment |
18.04 setup step-by-step
In short you need:
sudo apt-get install cloud-image-utils
cat >user-data <<EOF
#cloud-config
password: asdfqwer
chpasswd: { expire: False }
ssh_pwauth: True
EOF
cloud-localds user-data.img user-data
# user-data.img MUST come after the rootfs.
qemu-system-x86_64
-drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
-drive file=user-data.img,format=raw
...
and now you can login with:
- username:
ubuntu
- password:
asdfqwer
The user-data.img
drive must be the second one after the first input image.
Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?
18.04 setup step-by-step
In short you need:
sudo apt-get install cloud-image-utils
cat >user-data <<EOF
#cloud-config
password: asdfqwer
chpasswd: { expire: False }
ssh_pwauth: True
EOF
cloud-localds user-data.img user-data
# user-data.img MUST come after the rootfs.
qemu-system-x86_64
-drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
-drive file=user-data.img,format=raw
...
and now you can login with:
- username:
ubuntu
- password:
asdfqwer
The user-data.img
drive must be the second one after the first input image.
Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?
edited 9 hours ago
answered Nov 19 '18 at 11:13
Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功
9,36444347
9,36444347
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f507345%2fhow-to-set-a-password-for-ubuntu-cloud-images-ie-not-use-ssh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown