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
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!
are you running the command as root?
you can try /sbin/service sshd start
You're a genius. :D
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.
Good to know!
|All times are GMT -5. The time now is 11:24 AM.|