LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Switching to Root (https://www.linuxquestions.org/questions/linux-newbie-8/switching-to-root-891844/)

adarshmca 07-15-2011 04:09 AM

Switching to Root
 
Dear all,

Today I faced a very strange issue while switching to root account in a bash shell.My OS : CentOS-5.1.4

I logged in my system with account name user1 and I open the terminal and below shell opens

[user1@localhost ]$

Now when I type su and want to switch to root account , it fails

[user1@localhost ~]$ su
Password:
su: incorrect password
[user1@localhost ~]$ exit

I know the password is 123 & I m 100% sure .

Can anyone tell me how to solve the issue.



Thanks

ButterflyMelissa 07-15-2011 04:12 AM

I miss the hyphen...try

Quote:

su -
Maybe (just maybe) that's the itch...

Thor

repo 07-15-2011 04:21 AM

Did it worked before?
Type the password in the userfield to see if the keyboard layout is correct.
Does it work when you login as root via
Code:

CTRL_ALT_F1
What happens if you use
Code:

sudo
Kind regards

16pide 07-15-2011 05:28 AM

let me guess:

the password WAS 123
someone logged in
changed the password
now you're locked out

If the system was connected to a network, it may well be what happened ...

ButterflyMelissa 07-15-2011 05:43 AM

@ 16pide

Hmmm...did'nt go there yet. Come to think of it, that is a possilbe scenario. At the sight of the password, I hoped it to be an isolated test system...but of course, when linked to a network... :)

theNbomr 07-15-2011 10:41 AM

You can reset the password by rebooting into single-user mode, and running the passwd command. To enter single use mode on most desktop or server systems, press any key at the grub prompt, and append the word 'single' to the 'append' entry for the kernel version you will be booting.

Use a strong password, and never use programs that send passwords in cleartext (telnet is the big loser here). And if you're on a network, don't forget it might be your host, but it's everyone's network, and we are all affected if your host gets hacked.

--- rod.

adarshmca 07-17-2011 11:51 PM

Thank U all,

I solved the issues by issuing the below command :

chmod 4755 /bin/su

& I also issue the below commands after some googling :

chmod 777 /usr/bin/passwd
chmod 777 /etc/passwd
chmod 777 /etc/shadow

Would it effects the system ?

Thanks

frieza 07-18-2011 12:22 AM

Quote:

Originally Posted by adarshmca (Post 4417752)
chmod 777 /usr/bin/passwd
chmod 777 /etc/passwd
chmod 777 /etc/shadow
Would it effects the system ?
Thanks

wherever you found that, that's horrible advice, whoever posted it should have their head examined.

/usr/bin/passwd should be 4755

/etc/passwd should be 644

and /etc/shadow should be 000

777 grants every user on the system read write and execute permissions to the files
two of which don't need ANYONE to have execute permission
and only ROOT should have write permission to /etc/passwd

NOBODY other than root should even be able to READ let alone WRITE to /etc/shadow and NOBODY should be able to write to the /usr/bin/passwd, it's a binary anyways so there isn't any need.

those permission settings are just asking for a trouble, big time
would it effect the system? YES it would leave a security hole big enough to pilot an aircraft carrier through.

16pide 07-19-2011 07:38 AM

like Frieza said, revert what you did to those crucial files. You've opened a major security hole!


All times are GMT -5. The time now is 01:58 AM.