Ask Your Question
0

Ubuntu Password Reset

asked 2016-12-12 15:26:40 -0600

Mbarker gravatar image

Hello,

I know this has been asked before but what I'm looking for is an answer, not a half baked copy and paste from the documentation...which doesn't help. I've been through every link in the Docs for Managing an instance but I can't quite figure it out.

The back story is, my company acquired a cloud computing company....however their support was....less than stellar, and didn't document very well.

Now, fast forward to the present, for 6 months I've gone without needing to be on any of the OS instances...until today (JOY!) Checking around my documentation that was given to me, no passwords...alright lets look at SSH keys..they provided 4...there's 20 VMs in that environment...which means something's amiss...tried setting up Security Groups and SSH Keypairs...still nada can't get into the machines...so I need to go through the painstaking process of resetting default passwords...ok so we start with:

http://docs.openstack.org/admin-guide/compute-admin-password-injection.html (http://docs.openstack.org/admin-guide...)

Well, it's all well and good that you tell me how to enable something...but how about...telling me how to do it - the doc kind of just stops...I find the documentation for this system pretty sub standard, I find better help files from Microsoft, which is pretty sad!

So can anyone tell me how I can get into my environments? I can get into the Dashboard fine, for some reason even after following all of the instructions to get openstack cli running on my computer it still refuses to run, I think it's the backwards way I have Windows setup on this computer so that's probably more my fault, but not being able to get into my VMs is actually making life pretty tense for me.

Any help on this would be much appreciated.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-03-07 23:31:19 -0600

amitabh sinha gravatar image

If you want to reset the ubuntu password while launching an ubuntu instance you can provide direct script under post creation creation and launched your ubuntu VM. direct input

cloud-config

password: root123 chpasswd: { expire: False } ssh_pwauth: True

edit flag offensive delete link more
0

answered 2016-12-12 20:36:34 -0600

fifieldt gravatar image

updated 2016-12-12 20:37:40 -0600

Hi,

Sounds like a bad day :)

Notes:

  • Assuming you are talking about Linux VMs that have been created through OpenStack
  • in general when you set up a VM image 'securely', you'll disable password login via SSH. So password injections may not help.
  • Having 4 ssh keys for 20 VMs doesn't necessarily mean anything is missing - it's quite normal for users making VMs to select the same SSH Keypair they have set up
  • A tool called cloud-init is what runs on VM boot time to download SSH Keys or inject passwords. It may only run once, when the machine is first created, depending on configuration.

How I'd go about working through this would be something like the following...

First, grab the administrator password for the OpenStack install and log in to the dashboard. From here, look up the target VM to find out information about it - which project started the VM, which keypair is listed against the VM, and where the security group allows access from. Depending on your version of OpenStack, you will either get this through the admin interface or have to select the project from a dropdown list and masquerade as that project's user.

If you can work out which key you were given corresponds to which keypair in OpenStack, you'll know if you have a usable key. If you do, find a place the securitygroup lets you login from and hope the firewall inside the VM lets you in. If it doesn't, you might be able to see something in the console log or graphical console as to why.

If none of your set of keys corresponds to the key used to configure the instance, you'll need to reset the password.

Luckily, VMs in OpenStack work much like normal machines. Use the dashboard to view the graphical console for the VM, then restart it. Break into grub like you would on a regular machine and set the root password (eg https://coderwall.com/p/vibura/reset-... ). Reboot again and you can then use the graphical console to login, change your SSH settings and work out what's going on.

HTH

edit flag offensive delete link more

Comments

Hey thanks for the info, sorry I guess I should have included some more info about the keys...they were provided with no info other than the noticeable format of a PEM file.

I took your advise and logged into the dashboard as admin, no addl info about keys and such, booting recov. locks up console

Mbarker gravatar imageMbarker ( 2016-12-12 21:16:45 -0600 )edit

Yup, so the PEM file is just the RSA private key - no magic. Go into the instance detail page for a VM, It will tell you the name of the keypair that was used. Then go to access and security and click to info on that keypair. The public key will be listed. Use ssh-keygen -y -f PEM_file to compare.

fifieldt gravatar imagefifieldt ( 2016-12-12 21:43:35 -0600 )edit

When we go into any of the Keypair tabs on any of the instances there is no keypairs listed (as I said it was kind of half-a$$ed when it was transferred over to us.I'm trying to figure out why Ubuntu locks up during recovery boot

Mbarker gravatar imageMbarker ( 2016-12-13 09:04:30 -0600 )edit

In this case, why not try going directly to the source of the VM. Shut down (but don't terminate) a VM you need to get into. SSH into the compute node that hosts it, then mount the filesystem for the VM (found in /var/lib/nova/instances) . Mess with the filesystem, boot it up again, login.

fifieldt gravatar imagefifieldt ( 2016-12-19 23:32:52 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-12-12 15:26:40 -0600

Seen: 1,373 times

Last updated: Mar 07 '17