Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian newbie-can't sign in as root

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
wiccanhart1
Posts: 2
Joined: 2010-01-22 22:58

Debian newbie-can't sign in as root

#1 Post by wiccanhart1 »

I just did clean install of Debian 503 today & it's so fast, I love it, compared to Ubuntu. I cannot install packages though as the normal user, it keeps asking me to sign as root. When I su- at terminal, it says I'm not in sudoers file..., or if I try root terminal it tells me wrong password. But I know I'm entering the password correctly. I cannot edit the /etc/sudoers file and save it unless I'm root apparently, so I am stuck. I don't know what to do. I've googled this & spent 2 hours now looking through the debian installation guides, etc., to no avail. Any help would be greatly appreciated. The install went fine, my basic question is, how do I sign in as root, or avoid using root and get things to work? Thanks.

refracta
Posts: 1234
Joined: 2008-10-26 01:46

Re: Debian newbie-can't sign in as root

#2 Post by refracta »

to become root you enter
su
and then the root password

wiccanhart1
Posts: 2
Joined: 2010-01-22 22:58

Re: Debian newbie-can't sign in as root

#3 Post by wiccanhart1 »

Hey thanks for the reply, but I already did that. I've been entering "su" and it says that I am not in the sudoers file. I think I don't understand how Debian works versus Ubuntu relating to sudo. I've already done what you told me to do, and it does not work. I am looking for the solution to why it is doing that.

refracta
Posts: 1234
Joined: 2008-10-26 01:46

Re: Debian newbie-can't sign in as root

#4 Post by refracta »

Why is it saying anything about sudo? You aren't using sudo. Where is sudo coming into all this?

Can you copy/paste exactly what you are doing in the terminal as well as the output you get?

User avatar
Radvan
Posts: 123
Joined: 2009-06-22 09:38
Location: Prague, Czech Republic

Re: Debian newbie-can't sign in as root

#5 Post by Radvan »

There are two root enabling apps: sudo and su. Sudo is used in Ubuntu and it does not work in Debian, you will not be a "sudoer" even if you are the one that has installed the operating system. Nevertheless, sudo can be found in Debian for some reason.
While being in Debian, forget sudo and similar commands (gksudo, etc.) and use su. Therefore:

(1) Open a terminal
(2) write su on the command prompt and press Enter ("su", not "sudo")
(3) you get a password prompt. Enter password and press Enter.
(4) you get a prompt with # at its end

You can run windowed apps from the command prompt. You will be root until you quit the root console (by entering "exit" command).

User avatar
roseway
Posts: 1528
Joined: 2007-12-31 22:50
Location: Kent, UK
Has thanked: 3 times
Been thanked: 4 times

Re: Debian newbie-can't sign in as root

#6 Post by roseway »

You can run windowed apps from the command prompt.
That's not the case. If you want to run windowed apps as root, type kdesu <program> (if you use KDE) or gksu <program> (if you use Gnome, or probably other desktop environments). Alternatively, you can install the package sux and then use sux instead of su.
Eric

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Debian newbie-can't sign in as root

#7 Post by Absent Minded »

Radvan wrote:There are two root enabling apps: sudo and su. Sudo is used in Ubuntu and it does not work in Debian, you will not be a "sudoer" even if you are the one that has installed the operating system. Nevertheless, sudo can be found in Debian for some reason.
While being in Debian, forget sudo and similar commands (gksudo, etc.) and use su. Therefore:

(1) Open a terminal
(2) write su on the command prompt and press Enter ("su", not "sudo")
(3) you get a password prompt. Enter password and press Enter.
(4) you get a prompt with # at its end

You can run windowed apps from the command prompt. You will be root until you quit the root console (by entering "exit" command).
Please make sure that you really check things before you make a statment saying something does not work in Debian... sudo works just fine in Debian it just has to be set up correctly first. That said, most Debian users prefer to use su instead of sudo. There are many reasons for this... doing a quick search on the topic should clue you in.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

User avatar
Radvan
Posts: 123
Joined: 2009-06-22 09:38
Location: Prague, Czech Republic

Re: Debian newbie-can't sign in as root

#8 Post by Radvan »

(1) gksu gnome-commander
(2) su gnome-commander

(3) su
gnome-commander
exit

I had (3) in mind. Wiccanhart1 wanted to log in as root, not run a single command as root. (1) works, (2) does not work as expected, (3) works, you can run both for CLI and windoed apps between "su" and "exit".

User avatar
roseway
Posts: 1528
Joined: 2007-12-31 22:50
Location: Kent, UK
Has thanked: 3 times
Been thanked: 4 times

Re: Debian newbie-can't sign in as root

#9 Post by roseway »

(3) works, you can run both for CLI and windoed apps between "su" and "exit".
As I said before, that isn't the case. If you try to open a windowed app after using su, you get an error message that it's unable to open the display. However, if you install the package sux, then su is symlinked to sux, and then you can run windowed apps after using su.
Eric

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: Debian newbie-can't sign in as root

#10 Post by nadir »

1) if one has got a display-manager installed (gdm,xdm,kdm,slim) you get an error when trying to open a gui-app from a terminal emulator as root (say: su ; gedit gives the said error).
one needs to make us of kdesu/gksu or sux.
2) if one don't have a display-manager installed it does work (become root with su and open any app you like)

thats how it is for me. ymmv.
i was wondering for a long time what trouble people were talking about, till i found out that they come up when i run a display-manager.

ps: same goes for sudo: it depends! if you don't allow root to login during installation you will get a sudo-account.
at least the last time i tried/tested.
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

User avatar
aspnair
Posts: 1247
Joined: 2009-06-18 12:27
Location: Twitter: @anand_sivaram

Re: Debian newbie-can't sign in as root

#11 Post by aspnair »

You could run graphical application as any user/root
But remember that starting graphical application as root is not secure.

This is what you need to do, incase you want to do.
This works with display managers.

Code: Select all

as user
xhost +
Now login to other user/root using su -
export DISPLAY=':0.0' (generally the display is 0)
graphicalapp
Compressed Air Energy Storage, Entropy and Efficiency
http://saurorja.org/2012/06/18/compress ... fficiency/

User avatar
Bro.Tiag
Posts: 1924
Joined: 2007-06-02 19:14

Re: Debian newbie-can't sign in as root

#12 Post by Bro.Tiag »

wiccanhart1 wrote:I just did clean install of Debian 503 today & it's so fast, I love it, compared to Ubuntu. I cannot install packages though as the normal user, it keeps asking me to sign as root. When I su- at terminal, it says I'm not in sudoers file..., or if I try root terminal it tells me wrong password. But I know I'm entering the password correctly. I cannot edit the /etc/sudoers file and save it unless I'm root apparently, so I am stuck. I don't know what to do. I've googled this & spent 2 hours now looking through the debian installation guides, etc., to no avail. Any help would be greatly appreciated. The install went fine, my basic question is, how do I sign in as root, or avoid using root and get things to work? Thanks.
When you installed debian you were asked for a "root" password and a user name & user password. When you type "su" you need to enter the "root" password you supplied during the instalation.

You can also use "su" with the command flag;

Code: Select all

su -c "<the set of commands to run>"
Cheers

davidmichell_s
Posts: 8
Joined: 2009-12-22 09:32

Re: Debian newbie-can't sign in as root

#13 Post by davidmichell_s »

Try opening a root terminal from the menu. There is a menu option to open the root terminal, when it opens, you will have to enter the password. This way there is no need to enter su command. If you still do not succeed then maybe the root password is incorrect(?).

oOarthurOo
Posts: 544
Joined: 2008-10-25 12:00
Location: Canada

Re: Debian newbie-can't sign in as root

#14 Post by oOarthurOo »

Not sure if OP has figured out how yet, but be sure you're not typing "sudo su". It's just "su".

User avatar
4D696B65
Site admin
Site admin
Posts: 2696
Joined: 2009-06-28 06:09
Been thanked: 86 times

Re: Debian newbie-can't sign in as root

#15 Post by 4D696B65 »

oOarthurOo wrote:Not sure if OP has figured out how yet, but be sure you're not typing "sudo su". It's just "su".
sad but true
maybe we need an ubuntu detox forum too. :lol:

smallchange
Posts: 1740
Joined: 2009-05-04 15:56
Been thanked: 1 time

Re: Debian newbie-can't sign in as root

#16 Post by smallchange »

aspnair wrote:You could run graphical application as any user/root
But remember that starting graphical application as root is not secure.

This is what you need to do, incase you want to do.
This works with display managers.

Code: Select all

as user
xhost +
Now login to other user/root using su -
export DISPLAY=':0.0' (generally the display is 0)
graphicalapp
This is certainly more insecure than it need be as you just allowed anyone from anywhere.

Code: Select all

xhost SI:localuser:root
will allow only root from the local machine.

I feel the need to once again rain on the anti sudo parade. Sudo was around long before Ubuntu and the fact that Uduntu decided to use it in a terrible way does not make sudo bad any more than the fact that Ubuntu decided to use Debian in a bad way makes Debian bad.

HyperHacker
Posts: 24
Joined: 2010-01-29 05:19

Re: Debian newbie-can't sign in as root

#17 Post by HyperHacker »

In Ubuntu you just do:
sudo somecommand
and enter your login password. IIRC you can run GUI apps this way, but gksudo is better for that.

In Debian by default you are not in the sudoers file so this will not work. You need to use the Root Terminal in the menu, and from there you could add yourself to /etc/sudoers, though someone with more experience would have to tell whether that's a good idea.

User avatar
4D696B65
Site admin
Site admin
Posts: 2696
Joined: 2009-06-28 06:09
Been thanked: 86 times

Re: Debian newbie-can't sign in as root

#18 Post by 4D696B65 »

HyperHacker wrote:In Ubuntu you just do:
sudo somecommand
and enter your login password. IIRC you can run GUI apps this way, but gksudo is better for that.

In Debian by default you are not in the sudoers file so this will not work. You need to use the Root Terminal in the menu, and from there you could add yourself to /etc/sudoers, though someone with more experience would have to tell whether that's a good idea.
dont try to turn debian into ubuntu

Post Reply