LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   service command not working for starting sshd (http://www.linuxquestions.org/questions/linux-newbie-8/service-command-not-working-for-starting-sshd-226158/)

naijaguy 09-03-2004 10:39 AM

service command not working for starting sshd
 
I recently installed Red Hat 8 on one machine and got sshd running, but now I'm trying to start it on another machine that I just installed the same OS on. Here's what I think I used last time--at least it's what I wrote down!

service sshd start

However, it tells me that the service command can't be found. I typed

locate service

and it returned a ton of results, but the last one was /sbin/service, so I changed directories to /sbin and typed that line above, but it still said the service command couldn't be found! I typed

ls -alF service

and service has an asterisk by it: service*

What's the problem? Last time I just typed that first line, and then to make sure it would start up after a reboot I typed this:

chkconfig --level 35 sshd on


What am I doing wrong? Thanks!

ppuru 09-03-2004 10:52 AM

are you running the command as root?

you can try /sbin/service sshd start

naijaguy 09-03-2004 11:29 AM

You're a genius. :D

ppuru 09-03-2004 11:47 AM

Thanks, I feel flattered.

If you gained root access using su, be sure to use

$ su -

instead of the regular su.

su - will set root's environment. So you will have /sbin and other locations where linux keeps it privileged files on your path.

If you log in directly as root, you won't face this problem ... but su - is the better way.

naijaguy 09-03-2004 11:49 AM

Good to know!


All times are GMT -5. The time now is 08:22 AM.