LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Unable to "su" after installing Proftpd in Debian 6 (https://www.linuxquestions.org/questions/linux-software-2/unable-to-su-after-installing-proftpd-in-debian-6-a-4175450402/)

tux75 02-16-2013 04:34 AM

Unable to "su" after installing Proftpd in Debian 6
 
I installed and configured Proftpd server on my Debian 6 system today.

It's a headless system and I am using SSH to connect. I can login as a normal user, But when I try to "su" to have root access I am getting below errros.

"Cannot execute ftp: No such file or directory"

Quote:

$ su
Password:
Cannot execute ftp: No such file or directory
$
$
$ su root
Password:
Cannot execute ftp: No such file or directory
$
$
If I give a wrong password for the root user it does recognise that.

Quote:

$ su
Password:
su: Authentication failure
$

Thanks

pingu 02-16-2013 05:04 AM

How is proftpd configured?
What shell does root have ("grep root /etc/passwd")
Do you have sudo, otherwise fixing might get troublesome...

tux75 02-16-2013 02:43 PM

It's running as an inted service with one virtual user.

Sudo is not installed, shell for root user I haven't checked. I wasn't expecting this sort of an error while installing a pack, never faced any thing like this before.

What all are my options?

pingu 02-16-2013 02:55 PM

Start with checking root shell!

tux75 02-16-2013 03:00 PM

How do I get there without root access?

pingu 02-16-2013 03:05 PM

Could you do me a favour? That is, please read suggestions you get and follow them.
"grep root /etc/passwd" - it's in my first post in this thread.

tux75 02-16-2013 03:13 PM

Oops sorry, I didn't notice that.

Quote:

$ grep root /etc/passwd
root:x:0:0:root:/root:ftp
$
How could this get changed?

pingu 02-16-2013 03:30 PM

That's just what I guessed!
See, the shell for root is now 'ftp'. It should be '/bin/bash/'.
With that shell for root, and without sudo, you're in trouble!
I don't know how it got wrong, probably you accidentally gave a wrong answer to a question.

But ok, now we know the problem - let's find a solution.
Quote:

Originally Posted by tux75 (Post 4893214)
"t's a headless system and I am using SSH to connect."

This is bad. Really bad.
Let me just hope that you actually can get to that machine physically - that is, either that you can plug in a keyboard & a monitor to it for a short while, or it's a virtualized machine and you control the host.
If none of this is true... I don't know, have to do some serious thinking.

But first, just to make sure (you ARE kind of a newbie, right? ;) )
Let's see if by chance 'sudo' is enabled.
In a terminal, type "sudo df" - this is just to test!
Probably you'll get something like "sudo - no such command", but if we're very very lucky sudo is there and you will be asked for your password.

So, return with:
1) What did the 'sudo' command reply
2) Can you access the machine physically or
3) Is it virtualized, then who controls the host (the computer on which virtualization runs)

If you don't understand something, just ask again!
And the more detailed info you can give, the easier it is to help!

tux75 02-16-2013 04:08 PM

No it's not virtualized, it's a physical system and by tomorrow I will have access to it once I reach home.

1) What did the 'sudo' command reply

Quote:

$user is not in the sudoers file. This incident will be reported.

Quote:

I don't know how it got wrong, probably you accidentally gave a wrong answer to a question.
Well this could be possible, I think I issued "chsh". Need to check the history once I get back the root access.

pingu 02-16-2013 04:17 PM

Quote:

Originally Posted by tux75 (Post 4893251)
No it's not virtualized, it's a physical system and by tomorrow I will have access to it once I reach home.

Very good!
What you do then is reboot the computer, boot from a live-cd (or any other system), access your debian-root and then change that line in /etc/passwd from
root:x:0:0:root:/root:ftp
to
root:x:0:0:root:/root:/bin/bash

... and the reply "... $user is not in the sudoers file..." implies you do have sudo!
But unfortunately your user is not a 'sudo-er' - and I guess you don't have any other user accounts on this system so it won't help you.(?)

Gotta sleep now, it's night here in my part of the world.
Looking forward to hear from you tomorrow!

tux75 02-18-2013 02:14 PM

Thanks a lot for the help pingu...

Managed it without a live CD as there was option in GRUB to boot in "recovery mode"


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