LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Password Problems [Elementary OS Luna] (https://www.linuxquestions.org/questions/linux-newbie-8/password-problems-%5Belementary-os-luna%5D-4175530906/)

anon287 01-13-2015 11:39 AM

Password Problems [Elementary OS Luna]
 
Hello everyone,

I am not a real n00b at linux but this question is kinda newbisch: I disabled a password for my profile and now i am trying to use sudo but I'm asked to enter a password. I have tried any possible password but I can't unlock it. Please Help!

I own a brandless PC with an Intel Celeron 3.06Ghz processor.
An Intel motherboard
The OS on this PC is Elementary OS Luna

Again please help me.

Very Kind Regards,
mrjenskay

Rubian 01-13-2015 11:56 AM

What is the command you are trying to enter?

anon287 01-13-2015 12:50 PM

Any sudo command,
sudo su, sudo apt-get install, sudo gedit, etc.

Rubian 01-13-2015 01:05 PM

And after you type your password, what does it say?

anon287 01-13-2015 01:12 PM

it says: "Sorry, try again."
and starts again

Rubian 01-13-2015 01:15 PM

It should be the password you chose when you install the OS.

vincix 01-13-2015 01:19 PM

Quote:

Originally Posted by mrjenskay (Post 5300315)
Hello everyone,

I am not a real n00b at linux but this question is kinda newbisch: I disabled a password for my profile and now i am trying to use sudo but I'm asked to enter a password. I have tried any possible password but I can't unlock it. Please Help!

I own a brandless PC with an Intel Celeron 3.06Ghz processor.
An Intel motherboard
The OS on this PC is Elementary OS Luna

Again please help me.

Very Kind Regards,
mrjenskay

What do you mean by disabling the password for your profile? And what do you mean by profile? You mean simply to say user? How did you actually disable it? Did you actually insert an ! in /etc/shadow or what did you do exactly?

anon287 01-13-2015 02:10 PM

Dear Rubian,
I previously said that i tried every possible password including my install password.

Dear vincix,
With disabling the password for my profile i do mean for my user account.
I did this by going to the system settings> user accounts > Password> disable


Kind Regards,
mrjenskay

vincix 01-13-2015 04:46 PM

Quote:

Originally Posted by mrjenskay (Post 5300407)
Dear vincix,
With disabling the password for my profile i do mean for my user account.
I did this by going to the system settings> user accounts > Password> disable

There might be some other more elegant solutions to this, but one solution would be to change the root password (and implicitly to create it, because on ubuntu-based distros there's no access to root by default, except with sudo). You can do that by pressing 'e' in Grub (before it boots). Search for the kernel line (the one with vmlinuz) and at the end append "/init/bash" then press ctrl+x.
This will take you to a console where you'll need to find the root partition of your elemenetary OS.
You can find this by fdisk -l (if you don't have windows installed or any other operating system, this should be simple)
Once you've identified it, you need to change the root.
Code:

# chroot /dev/sdXY
(first one is a letter - it identifies the hdd, the second one is a number, it identifies the partition number)
Now you need to remount your partition in order to have read-write access to your partition, so enter:
Code:

# mount -n -t remount,rw /
(it simply remounts the partition of your operating system, so for that you need to specify /, the root path)
OK, once here you can simply change the password by typing passwd directly or, if you don't want to activate root, I think it might work changing the password of your username directly, so type:
Code:

passwd user
Enter your new password, restart and the OS will boot normally (what you will have changed in Grub only applies to that particular session, there's no permanent change).


All times are GMT -5. The time now is 02:52 PM.