LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 09-03-2004, 10:39 AM   #1
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Rep: Reputation: 15
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!
 
Old 09-03-2004, 10:52 AM   #2
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 46
are you running the command as root?

you can try /sbin/service sshd start
 
Old 09-03-2004, 11:29 AM   #3
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Original Poster
Rep: Reputation: 15
You're a genius.
 
Old 09-03-2004, 11:47 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 46
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.
 
Old 09-03-2004, 11:49 AM   #5
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Original Poster
Rep: Reputation: 15
Good to know!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"service __ restart" bash command isn't working case1984 Linux - Newbie 9 04-10-2008 02:35 PM
Trying to make my sshd service to work. Help please! babyboss Linux - Distributions 3 10-28-2004 09:09 PM
Won't Boot - Starting Printer Service - Starting CUPS jeansond Linux - Newbie 0 10-11-2004 06:39 PM
Starting Apache2 using Service Command liaaam Linux - Software 2 06-14-2004 05:06 AM
Starting sshd: [ OK ] pk21 Linux - General 4 03-05-2003 04:27 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration