LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2012, 10:51 PM   #1
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Rep: Reputation: Disabled
how do i fix this?


[rohini@roha ~]$ su
Password:
rohini is not in the sudoers file.This incident will be reported.

I use fedora on vmware and i'm completely new to both!
Thank you!

Last edited by lxmirmsh; 12-01-2012 at 11:03 PM.
 
Old 12-01-2012, 11:29 PM   #2
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 780
Blog Entries: 6

Rep: Reputation: 75
try su with -
like this

Code:
[rohini@roha ~]$ su -
if not work then while boot login as root
learn sudo if you need how to add rohini to sudo
i on my own system never need sudo btw
 
Old 12-02-2012, 01:35 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
rohini is not in the sudoers file.This incident will be reported.
You get this message when you invoke commands with "sudo" (and you're not authorized), not when you simple do a su.
Here simply invoking su means that you're trying to switch to root's account. And getting a message after entering password means, password you've entered is wrong or you're not authorized. So once check whether you've permission to do sudo or not, using:
Code:
sudo -l
And share it's output here.

Last edited by shivaa; 12-02-2012 at 01:39 AM.
 
Old 12-02-2012, 01:52 AM   #4
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
You get this message when you invoke commands with "sudo" (and you're not authorized), not when you simple do a su.
Here simply invoking su means that you're trying to switch to root's account. And getting a message after entering password means, password you've entered is wrong or you're not authorized. So once check whether you've permission to do sudo or not, using:
Code:
sudo -l
And share it's output here.
[rohini@roha ~]$ sudo -l
[sudo] password fro rohini:
Sorry, user may not run sudo on roha.
 
Old 12-02-2012, 02:10 AM   #5
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Has your "su" been aliased to "sudo"?
Code:
type su
/bin/su -
 
Old 12-02-2012, 02:11 AM   #6
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
[QUOTE=routers;4841012]try su with -
like this

Code:
[rohini@roha ~]$ su -
i tried that too! still the same message.
when i directly try
[rohini@roha ~]$ sudo yum install gcc
[sudo] password for rohini:
rohini is not in the sudoers file.this incident will be reported.
 
Old 12-02-2012, 02:13 AM   #7
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
Code:
type su
/bin/su -
it says
su is /bin/su

Last edited by lxmirmsh; 12-02-2012 at 02:19 AM.
 
Old 12-02-2012, 02:13 AM   #8
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Alright, it means you're not authorized to invoke commands with "sudo".
On the other hand, if you want to simple switch to any other user account, just use:
Code:
su - <username>
For example:
Code:
su - root
su - jack
Moreover, if you want to use sudo, then mention your purpose.

--- ADDING INFO. ----
When you use:
Code:
su - root
su root
su 
su -
su -s
Will all bring you to root's account, if you have a correct password of root user. All these are different syntax to switch to root user.

Last edited by shivaa; 12-02-2012 at 02:17 AM.
 
Old 12-02-2012, 02:25 AM   #9
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
Code:
su - <username>
it asks for password and when i give the password it displays the same message.
the log in password is the password to be given right?
 
Old 12-02-2012, 02:46 AM   #10
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by lxmirmsh View Post
Code:
su - <username>

it asks for password and when i give the password it displays the same message.
the log in password is the password to be given right?
<username> is not your own username, but it is user name of the user with whom you want to switch. Suppose there's another user named peter in your system, and you want to switch to peter's account, then you should use:
Code:
su - peter
After that when it ask for password, you will need to enter that user's password (i.e. pater's), not your own password.

To make it more clear, when you do:
su - <username> .... Then enter <username> uesr's password, not your own password.
sudo su - <username> ..... Then enter your own password, not <username> user's password.
 
Old 12-02-2012, 03:18 AM   #11
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
<username> is not your own username, but it is user name of the user with whom you want to switch. S

yes, i know that.
I'm the only user on the system.
can i change the root password?
 
Old 12-02-2012, 06:00 AM   #12
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
i changed the root password and it worked like a charm!
thank you all for your time.really appreciate it!
 
Old 12-02-2012, 06:16 AM   #13
RaviTezu
Member
 
Registered: Nov 2012
Location: India
Distribution: Fedora, CentOs, RHEL
Posts: 164

Rep: Reputation: 24
Hey rohini,

Issuing commands as a root user is not recommended.

Try to add your username to /etc/sudoers files, in order get the privileges of root user.

you can find an example in the file itself.,like..,

Quote:
%wheel ALL : (ALL) NOPASSWD: ALL
So add your username as the above..i.e

Quote:
rohini ALL: (ALL) NOPASSWD: ALL
to the /etc/sudoers file..from now you can use "sudo" with any command.


Good luck.
 
Old 12-02-2012, 06:21 AM   #14
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
@ravitezu

yes,i've done that!
thank you!
 
Old 12-02-2012, 06:23 AM   #15
RaviTezu
Member
 
Registered: Nov 2012
Location: India
Distribution: Fedora, CentOs, RHEL
Posts: 164

Rep: Reputation: 24
you're welcome rohini
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
FIX---Fedora install hangs---To fix this---- jmckinzie Fedora - Installation 0 12-20-2005 01:08 AM
all attempts to fix the problem failed... can someone help me fix partition space? foreverdita Linux - Enterprise 2 05-11-2005 10:02 AM
reiserfsck --fix-fixable -> --fix-fixable ignored - why? BrianK Linux - Software 1 01-07-2005 09:45 PM
How do i fix this? glitch Linux - Newbie 22 09-21-2002 09:08 AM
How can i fix this jester_69 Linux - Networking 1 09-11-2002 02:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:22 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration