Unable to login into root using su command

If none of the more specific forums is the right place to ask

Unable to login into root using su command

Postby santhosh.cnp » 2008-08-19 17:23

Hi all,
I am new to linux. I have installed debian linux in my computer. After that I installed the application python, c++, mozilla. After that i couldn't able to login root account for further installation.
while using su command i am gettring following error,
Code: Select all
santhosh@debian:~$ su root
Password:
Cannot execute santhosh: No such file or directory
santhosh@debian:~$

I am sure i gave correct root password, if i give wrong root password output is,
Code: Select all
santhosh@debian:~$ su root
Password:
su: Authentication failure
Sorry.
santhosh@debian:~$


Also i tried to access User Account in GUI (Desktop->Administration->Users and Groups) linux asking root password, after that i am getting error window,
Failed to run users-admin as user root.
Failed to Communicate with gksu-run-helper.
Received:
ssword:
While expecting:
gksu: waiting

Please help me,
Regards,
Santhosh
[/code]
santhosh.cnp
 
Posts: 4
Joined: 2008-08-19 17:03

Postby jtodd » 2008-08-19 17:35

Try just su instead of su root.
Debian GNU/Linux Sid | Intel Celeron 2.2GHz | 224mb RAM | 27GB HD | 320GB Ext. HD | dwm
User avatar
jtodd
 
Posts: 459
Joined: 2008-06-04 01:24
Location: Michigan

Postby industrialpunk » 2008-08-19 17:40

This seems weird, but did you change the name of root's shell in /etc/passwd from "/bin/bash" to "santosh"?

It should look like
Code: Select all
root:x:0:0:root:/root:/bin/bash
-Josh Willingham
User avatar
industrialpunk
 
Posts: 733
Joined: 2007-03-07 22:30
Location: San Diego, CA, USA

Postby santhosh.cnp » 2008-08-19 18:04

jtodd wrote:Try just su instead of su root.

I am getting same error,
Code: Select all
santhosh@debian:~$ su
Password:
Cannot execute santhosh: No such file or directory
santhosh@debian:~$
santhosh.cnp
 
Posts: 4
Joined: 2008-08-19 17:03

Postby santhosh.cnp » 2008-08-19 18:11

industrialpunk wrote:This seems weird, but did you change the name of root's shell in /etc/passwd from "/bin/bash" to "santosh"?

It should look like
Code: Select all
root:x:0:0:root:/root:/bin/bash


passwd file content as follows,
root:x:0:0:root:/root:santhosh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
Debian-exim:x:100:102::/var/spool/exim4:/bin/false
statd:x:101:65534::/var/lib/nfs:/bin/false
identd:x:102:65534::/var/run/identd:/bin/false
messagebus:x:103:104::/var/run/dbus:/bin/false
avahi:x:104:105:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
haldaemon:x:105:108:Hardware abstraction layer,,,:/home/haldaemon:/bin/false
gdm:x:106:111:Gnome Display Manager:/var/lib/gdm:/bin/false
hplip:x:107:7:HPLIP system user,,,:/var/run/hplip:/bin/false
santhosh:x:1000:1000:santhosh,,,:/home/santhosh:/bin/bash

How could I change
Code: Select all
root:x:0:0:root:/root:santhosh

to
Code: Select all
root:x:0:0:root:/root:/bin/bash

I couldn`t modify the file. (I have no permission to modify this file).
Can you give any idea to enter into the root account.
santhosh.cnp
 
Posts: 4
Joined: 2008-08-19 17:03

Postby industrialpunk » 2008-08-19 19:25

You can try booting into single user mode from the Grub prompt at boot.

If that fails because of the bad passwd file, you can try the following.


Reboot,

1) At Grub prompt press 'e' to edit command before booting.

2) Select kernel line

3) press 'e' to edit that line

4) Type following line at end of root line
init=/bin/sh

5) then press 'b'

You should then boot into a single user shell


If that also fails you can boot from a livecd, mount your linux hard drive, and edit the /etc/passwd file on your system (don't confuse it with the /etc/passwd on the livecd filesystem.)

How did you mess up your passwd file anyways?
-Josh Willingham
User avatar
industrialpunk
 
Posts: 733
Joined: 2007-03-07 22:30
Location: San Diego, CA, USA


Return to General Questions

Who is online

Users browsing this forum: No registered users and 19 guests

fashionable