LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "su - root" giving incorrect password but normal root login works. (https://www.linuxquestions.org/questions/linux-newbie-8/su-root-giving-incorrect-password-but-normal-root-login-works-4175461215/)

Fuzail 05-06-2013 06:26 AM

"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

shivaa 05-06-2013 08:10 AM

Quote:

Originally Posted by Fuzail (Post 4945852)
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?

Fuzail 05-06-2013 09:27 AM

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.

shivaa 05-06-2013 09:47 AM

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.

chrism01 05-06-2013 07:54 PM

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

Fuzail 05-06-2013 11:13 PM

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

chrism01 05-07-2013 03:58 AM

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. :)

Fuzail 05-07-2013 04:53 AM

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.

chrism01 05-07-2013 04:59 AM

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.

Fuzail 05-07-2013 06:24 AM

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 ?


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