LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-06-2013, 06:26 AM   #1
Fuzail
LQ Newbie
 
Registered: May 2013
Posts: 7

Rep: Reputation: Disabled
"su - root" giving incorrect password but normal root login works.


Hi i am having same problem as i can login to root from GUI and from ssh but when i switch user to oracle or any other then i try to come back by su - and it gives me incorrect password error

please help
 
Old 05-06-2013, 08:10 AM   #2
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
Thumbs down

Quote:
Originally Posted by Fuzail View Post
Hi i am having same problem as i can login to root from GUI and from ssh but when i switch user to oracle or any other then i try to come back by su - and it gives me incorrect password error
Do not continue an old thread (which is not even yours), but instead open a new one.

Did you try the solutions suggested above before posting? If yes, then what's result?
 
Old 05-06-2013, 09:27 AM   #3
Fuzail
LQ Newbie
 
Registered: May 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi, i have tried to do those things that are already discussed but still i am not able to connect via root use after switching to any other user. some people suggest it has something to do with su i tried to set visudo for user oracle like


oracle ALL=(ALL) ALL

but still oracle to root switching is not working giving me incorrect password error.
 
Old 05-06-2013, 09:47 AM   #4
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
There's difference between su (switch user) and sudo (superuser do). Both are different so don't confuse with them.

However, once login as root user and edit /etc/shadow file. Remove encrypted password for root user i.e. 2nd entry against root user (marked in red) leave it blank as:
Code:
BEFORE:
root:abcfdfdflfdlkdf:....:...:...:....
AFTER:
root::....:...:...:....
Save and close the file and then invoke passwd command to reset root's password.
Then again login as any normal user and try su - root or su - or su and use new password for login.

Last edited by shivaa; 05-06-2013 at 09:49 AM.
 
Old 05-06-2013, 07:54 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,342

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
sudo is actually 'substitute user do', in relation to su 'substitute user' (or switch user).
In both cases, assuming you have the setup/passwd, you can move from one user to ANY other user, not just root.
http://linux.die.net/man/8/sudo
http://linux.die.net/man/1/su
 
Old 05-06-2013, 11:13 PM   #6
Fuzail
LQ Newbie
 
Registered: May 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Yes i understand this but the problem is when i switch user from root to other user it connect to it but after this when i try to switch back to root by su - or su it asked me password and when i give password it shows incorrect password but i can connect with same password to GUI mode or by ssh

so what is the problem i cannot switch back to root?

please help
 
Old 05-07-2013, 03:58 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,342

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
If you've gone from any user (eg root) -> another user (eg oracle), then just exit that other user (oracle) session.
su and sudo both open a new session, they don't kill/replace the original session.
 
Old 05-07-2013, 04:53 AM   #8
Fuzail
LQ Newbie
 
Registered: May 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
the problem occurs when i login to user oracle and after that for some reason i try to connect to root through terminal and it gives me incorrect password error.
 
Old 05-07-2013, 04:59 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,342

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
Try it from other users; create a bare test user if required.
A small possibility is that the env in the oracle user is set to a different locale.
 
Old 05-07-2013, 06:24 AM   #10
Fuzail
LQ Newbie
 
Registered: May 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
i have tried with another user but still can not login with root also i cannot login to any other account from any other account

i have created user syed

from syed i cannot switch to root/oracle by su - oracle and su - root and from oracle i cannot switch to syed and root

it means something wrong with my su i think

any help ?
 
  


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
[SOLVED] "Login incorrect" error after boot - no password prompted rramesh1 Linux - Newbie 5 05-22-2011 12:39 PM
"su - root" giving incorrect password but normal root login works. ?? arashi256 Linux - Newbie 10 06-03-2010 03:13 AM
New system won't allow root after installation - using correct password and "root" kn2y Linux - Newbie 6 11-07-2008 07:52 PM
root password doesn't work at log in, works using "su" etfd Red Hat 3 01-10-2007 06:38 AM

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

All times are GMT -5. The time now is 10:44 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