LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 05-31-2004, 04:43 PM   #1
JunZ
LQ Newbie
 
Registered: May 2004
Posts: 19

Rep: Reputation: 0
How to login as root?


I am all confused about the root stuff, I have only one account and I think it's an administrator account, but when I try to do anything in /usr folder I got access denied
 
Old 05-31-2004, 05:00 PM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
if you're the only user, give a command (in terminal/console)

who

and you should see a line with the username you use. to become a root from another account, in terminal/console give a command

su

and type your password for root if you know it.
 
Old 05-31-2004, 05:09 PM   #3
JunZ
LQ Newbie
 
Registered: May 2004
Posts: 19

Original Poster
Rep: Reputation: 0
When I typed who nothing appeared, then when I typed su (I dont have a password) I get [root@localhost JunZ]# but I still get access denied in /usr
 
Old 05-31-2004, 07:50 PM   #4
Obie
Member
 
Registered: Apr 2004
Distribution: Red Hat
Posts: 290

Rep: Reputation: 30
JunZ,

Type the ls -l /user
It will print the permissions of the directoy, who the owner is and which group it belongs to. That should give you some guidelines who the directory belongs to.

To find out who you are e.g. who are logged in as type in whoami
 
Old 06-01-2004, 06:27 AM   #5
diabolus
LQ Newbie
 
Registered: May 2004
Posts: 18

Rep: Reputation: 0
Quote:
When I typed who nothing appeared, then when I typed su (I dont have a password) I get [root@localhost JunZ]# but I still get access denied in /usr
Eh, are you saying you don't know the root password, or that you never set a root password? If you don't know it, then you're somewhat screwed [you usually set the root password during installation], although i'm sure there's a way to reset the password, but i don't know how and i seriously doubt it's that easy.

Alternately if your root password is simply not set [or blank] then usually i'd do the following:
type "su root passwd" . Then it'll ask for a password, type the password you want for root. Then you can login as root using that password [by typing su etc].

There is a graphical way to log in as root too, but you still need the root password for that.
The general way to do that is to edit the Login settings [which you'll find under "Configure you desktop" menu]. You will need the root password to edit that too, but if you somehow can edit that, then maybe you can try editing the tab where it shows you the users on the system. By default it autologs a non-root user into the system, you can set that so you can pick a user to login at startup instead. Then you can simply go "Log out" and "End this Session only" and then login as root via the graphical thing. Although i don't think it's the 'ideal' way, but at least you'll be in a graphical interface as root and can then open up a filebrowser and right click on a folder and edit the permissions/owner on the file. [which is much easier than figuring out how chmod and certain console commands work].

Above method is almost exactly like you would do it in Windows XP/2000.

Last edited by diabolus; 06-02-2004 at 03:32 AM.
 
Old 06-01-2004, 07:12 AM   #6
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
--and can then open up a filebrowser and right click on a folder and edit the permissions/owner on the file. [which is much easier than figuring out how chmod and certain console commands work]
diabolus, sorry but I disagree on that if you spend half a minute to figure out chmod, chown and chgrp, through manpages for example, then from that moment on your every permissions-job is done much much much faster than before - and it truly isn't difficult. or to make it simple: if you have a directory called Directoryname and want to change it's owner and permissions, it's much faster to type

chown newuser Direc<now press tab to complete the name>
chmod 644 Direc<press tab to complete the name>

than open up a filebrowser (takes time), locate the file among many others, right-click it, wait a moment, click few boxes and so on. learning the meaning of 644 above and the other permission-numbering-system is quite simple, and once you've learnt it, you'll never again say it's difficult

ok, a bit offtopic, but....

EDIT: and one more thing. whoami tells your login as was said, and w tells who are around....but simple w gives a bit more information about the users around then just who, so try it. quite a simple command, just one letter

I'm just a bit confused about the su-login-stuff that didn't need a password...it means that root password is not set or empty, as was said, but what is odd is that root wouldn't have permissions to some directory? huh? the only thing I can imagine of that is, that somehow the read/write permissions of the directory have _all_ been removed so that it's unusable for anyone. that's easily fixed, though, with

chmod u+rw /usr

and then, if you're root, read and write permissions for root for that directory should be set.

Last edited by b0uncer; 06-01-2004 at 07:18 AM.
 
Old 06-01-2004, 07:51 AM   #7
diabolus
LQ Newbie
 
Registered: May 2004
Posts: 18

Rep: Reputation: 0
Yes of course if you got the hang of the console it's going to be faster and probably easier.
I just mentioned the graphical method because it's what us windows people are use to. From the original post i deduced the one asking for help is somewhat new and throwing console commands at someone who doesn't even seem sure about what root is, is somewhat dodgy.



Last edited by diabolus; 06-01-2004 at 07:55 AM.
 
Old 06-01-2004, 12:58 PM   #8
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
well, if you put it like that, yes. anyway, even beginners learn and they do it quickly after all, so it's no harm to start using console in the beginning..but of course after windoze it's somekind of a jump to sit before a linux console, especially if one hasn't used DOS before to get anykind of grip of the thing

still, it's quite a nice thing I think, that people start using linux more easily than before..some years back I didn't know too many who would have started using linux without somekind of course or teacher; now these "newbies" install a distro and come here to ask how it works...great and damn, again I've run off the topic...sorry.
 
Old 06-01-2004, 01:16 PM   #9
MATJA_KAE_92
Member
 
Registered: Jan 2004
Location: Slovenija
Distribution: Mandriva LE 2005
Posts: 54

Rep: Reputation: 15
You don't need console to edit settings as root.
Press alt + f2, type "kdesu konqueror".
If you set "no password" during the installation, the konqueror will just open and you will be able to use it as root.
 
Old 06-02-2004, 03:36 AM   #10
diabolus
LQ Newbie
 
Registered: May 2004
Posts: 18

Rep: Reputation: 0
Although i must admit is much easier to tell someone to type a few console commands than to try and describe where he must click and what menuitem to select and what box to edit.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to login as user; can login as root. rksanders Debian 24 02-09-2011 08:01 AM
wrong login shell prevent root login cefs99 Linux - Security 4 05-31-2006 08:28 AM
I have re-installed MK 9.2 but cannot login as user, login as root works. bobinglis Mandriva 2 02-22-2004 11:39 AM
can only login as root? user login doesnt work..? anyone? hacking_4_b33r Linux - General 1 02-05-2004 11:40 PM
root login incorrect ,then passwd root,but error sunnycn Linux - Security 6 05-20-2002 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 11:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration