LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sudo psswrd prob. (https://www.linuxquestions.org/questions/linux-newbie-8/sudo-psswrd-prob-821935/)

nnjond 07-24-2010 03:38 PM

sudo psswrd prob.
 
Hi,
There's something i don't understand. I only used one password while installing Fedora 13, but am having trouble with admin access:

Code:

[fedjond@Fedora13 ~]$ echo 'fedjond ALL=(ALL) ALL' >> /etc/sudoers
bash: /etc/sudoers: Permission denied

[fedjond@Fedora13 ~]$ sudo su
[sudo] password for fedjond:
fedjond is not in the sudoers file. This incident will be reported.
[fedjond@Fedora13 ~]$



Can you point it out please?

thanks for your time

TB0ne 07-24-2010 03:55 PM

Quote:

Originally Posted by nnjond (Post 4044188)
Hi,
There's something i don't understand. I only used one password while installing Fedora 13, but am having trouble with admin access:

Code:

[fedjond@Fedora13 ~]$ echo 'fedjond ALL=(ALL) ALL' >> /etc/sudoers
bash: /etc/sudoers: Permission denied

[fedjond@Fedora13 ~]$ sudo su
[sudo] password for fedjond:
fedjond is not in the sudoers file. This incident will be reported.
[fedjond@Fedora13 ~]$

Can you point it out please?
thanks for your time

Point out what? That the security on your box is working exactly the way it should be?

You are a non-root user, and are obviously denied access to the file. Either run that command as root (NOT recommended), or use the proper method and run visudo, to put yourself in the sudo'ers file. If you're not in sudoers, you won't be able to run sudo commands, no matter what password, or how many times you try.

Run "su - root", log in as root, and run visudoers to add your user.

zirias 07-24-2010 03:57 PM

maybe there is a password set for the root account (the single one you used)? Did you try just "su" with that password?

If it doesn't work, you can always "crack" root locally when you control the machine by passing "init=/bin/sh" to the kernel when booting and then mounting / rw ("mount / -o remount,rw") and setting a new root password with "passwd". Don't forget to remount / ro ("mount / -o remount,ro") before turning off the system.

If you don't want a root password, set something like * or ! as the password hash in /etc/shadow for root, but make sure you can sudo before. On a side note: never edit /etc/sudoers directly, use visudo :)

jefro 07-24-2010 06:06 PM

It said sudo won't work so you have to use su or add your name to the sudoers list. It asks for the admin password not your user.

r3sistance 07-24-2010 06:55 PM

Quote:

Originally Posted by zirias (Post 4044214)
If it doesn't work, you can always "crack" root locally when you control the machine by passing "init=/bin/sh" to the kernel when booting and then mounting / rw ("mount / -o remount,rw") and setting a new root password with "passwd". Don't forget to remount / ro ("mount / -o remount,ro") before turning off the system.

Thankfully, unlike Ubuntu (and debian?), Fedora doesn't by default password single user mode so just easier to place a 1 at the end of the kernel line, no messing about then.


All times are GMT -5. The time now is 09:14 PM.