LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-15-2011, 05:09 AM   #1
adarshmca
LQ Newbie
 
Registered: Dec 2010
Posts: 28

Rep: Reputation: 0
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

Last edited by adarshmca; 07-15-2011 at 05:36 AM.
 
Old 07-15-2011, 05:12 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
I miss the hyphen...try

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

Thor
 
Old 07-15-2011, 05:21 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
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

Last edited by repo; 07-15-2011 at 05:37 AM.
 
Old 07-15-2011, 06:28 AM   #4
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
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 ...
 
1 members found this post helpful.
Old 07-15-2011, 06:43 AM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
@ 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...
 
Old 07-15-2011, 11:41 AM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.

Last edited by theNbomr; 07-15-2011 at 11:43 AM.
 
1 members found this post helpful.
Old 07-18-2011, 12:51 AM   #7
adarshmca
LQ Newbie
 
Registered: Dec 2010
Posts: 28

Original Poster
Rep: Reputation: 0
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
 
Old 07-18-2011, 01:22 AM   #8
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
Quote:
Originally Posted by adarshmca View Post
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.

Last edited by frieza; 07-18-2011 at 01:27 AM.
 
2 members found this post helpful.
Old 07-19-2011, 08:38 AM   #9
16pide
Member
 
Registered: Jan 2010
Posts: 418

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


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
Switching to Root in Slackware v12 bo_akins Linux - Newbie 10 10-04-2007 06:06 PM
Switching root with initramfs slacker9 Slackware 5 07-24-2007 05:15 PM
Quickly switching to root artificialGekko Linux - Newbie 9 03-09-2005 07:44 AM
switching to root Stan the caddy Linux - Newbie 9 01-17-2004 03:54 AM
Switching between root and user PapaNoHair Slackware 14 07-28-2003 01:58 PM


All times are GMT -5. The time now is 08:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration