LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Why can't I start sshd? (http://www.linuxquestions.org/questions/linux-server-73/why-cant-i-start-sshd-725453/)

Jani64 05-12-2009 10:27 AM

Why can't I start sshd?
 
Note: I do not have physical contact with my server, I have to call a friend and guide him(knows no Linux himself) whenever I need something done.

Hello! I've recently started using Linux(I'm a newbie) and decided to set up a server, and ssh worked fine for a while, until I started trying to get vsftpd to work, so here's my problem:

I tried getting vsftpd to work, I was able to log into my ftp client, but not transfer files (533 error, cannot write file), so I googled a little and they said it was because of bad user permissions, so they said that it would work if I wrote "sudo chown -R jani /var/vsftpd".

I tried that, and then ftp://jani64.ath.cx/ stopped working at all and I couldn't log into my FTP client. I was still logged into SSH though, but then later logged out because I rebooted my machine. And then when I tried logging in again, I get "Network error: Connection refused" in PuTTy.

Then I ran "nmap jani64.ath.cx -p22;" and it gave me this:
(85.167.228.130):
PORT STATE SERVICE VERSION
22/tcp open tcpwrapped

Then I called my friend to see if he could just stop the vsftpd service and restart the sshd service, to see if it works then. He was able to stop the vsftpd service but he wasn't able to start sshd, and it tells him that group must be owned by root or something along those lines.

So basically, my permissions are messed up, what do I do to make SSH work again?

Thanks in advance!

wolfperkins 05-12-2009 10:46 AM

Which distribution of linux is this?

Typically users manipulating O/S services must do so as root. Tell your friend to log into the server as the root account and try:

# /etc/init.d/sshd status

Jani64 05-12-2009 11:06 AM

I'm on Fedora 10

# /etc/init.d/sshd status
tells me that openssh daemon is stopped(because I don't have the permissions to start it, even as sudo)

latinmusic74 05-12-2009 01:36 PM

Try chkconfig --list sshd to see is the SSHD daemon is ON.

AlucardZero 05-12-2009 07:03 PM

You're going to need to post the exact "something along those lines."

Jani64 05-13-2009 01:35 PM

Quote:

Originally Posted by AlucardZero (Post 3538787)
You're going to need to post the exact "something along those lines."

# sudo service sshd start
/var/empty/sshd must be owned by root and not group or world-writable

AlucardZero 05-13-2009 01:48 PM

Quote:

/var/empty/sshd must be owned by root and not group or world-writable
That's clear enough: check the ownership and permissions on /var/empty and /var/empty/sshd. They must be owned by root (chown root /var/empty; chown root /var/empty/sshd) and not be writable by anyone except root (chmod go-w /var/empty/sshd; chmod go-w /var/empty). All commands run as root.

How did this happen?
Quote:

so they said that it would work if I wrote "sudo chown -R jani /var/vsftpd".
You must have mistyped and done "chown -R /var /vstfpd" or any number of variations that would hit more than vsftpd. Be careful when doing thing, especially when sudoing them!

forrestt 05-13-2009 01:56 PM

Have your friend run the commands (as root):

Code:

chown root:root /var/empty/sshd
chmod 711 /var/empty/sshd
/etc/init.d/sshd start

That should start sshd and you should then be able to log back in (unless there are additional problems):).

HTH

Forrest

Jani64 05-13-2009 03:39 PM

Quote:

Originally Posted by forrestt (Post 3539708)
Have your friend run the commands (as root):

Code:

chown root:root /var/empty/sshd
chmod 711 /var/empty/sshd
/etc/init.d/sshd start

That should start sshd and you should then be able to log back in (unless there are additional problems):).

HTH

Forrest

This fixed my problem!
Thank you!


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