LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Can't ssh to server when server is in runlevel 5? (https://www.linuxquestions.org/questions/linux-networking-3/cant-ssh-to-server-when-server-is-in-runlevel-5-a-67802/)

begacjj 06-24-2003 06:17 PM

Can't ssh to server when server is in runlevel 5?
 
Hello,

When I switch our server to runlevel 5 from runlevel 3 I loose ssh and httpd access into our server? I ran serviceconf after booting into runlevel 5 and made sure the xinetd, ssh and httpd services were enabled. When the server is in runlevel 3 ssh and httpd work perfectly? Also, I can startx from runlevel 3 and ssh and httpd still work? I am running Redhat 7.3 and OpenSSH. I don't have much experience working with X as I have always worked in runlevel 3 previously. I may be going about this the wrong way. What I am trying to do is get a program to run upon startup. This program has to be run from an xterm. Currently, if I reboot our server I have to then login locally, startx and then run the program from the xterm. When I do that the program works as well as ssh and httpd. The problem is this server is going to be installed remotely so I need the program to run automatically if the server gets reset. Sorry if this is to much of a newbie question to be in the Networking forum?

Any help would be greatly appreciated.

Thanks,

Chris

david_ross 06-25-2003 01:21 PM

Try:
chkconfig --level 345 httpd on
chkconfig --level 345 sshd on

begacjj 06-25-2003 02:36 PM

David,

Thanks for the suggestion but unfortunately that did not solve my problem. Httpd was already turned on in 3,4,5 and sshd was turned on in 3 and 5 but not 4. Sshd is now on in 3,4,5 but still can't access the server via ssh or httpd although they are running on the server?? Any other ideas?

Thanks,

Chris

Crashed_Again 06-25-2003 03:45 PM

chkconfig justs adds the daemons to the appropriate runlevel so that they are started during boot time. It does not start the services. Did you do:

/etc/init.d/sshd restart

????

Does it say that stopping sshd failed? If so, it was not on.

begacjj 06-25-2003 04:06 PM

Crahsed_Again,

I booted into runlevel 5 after running chkconfig and ran:

/etc/rc.d init.d/sshd status

and it says it is running??

david_ross 06-26-2003 12:25 PM

Maybe you have firewall rules that are blocking it.

begacjj 06-26-2003 12:42 PM

I don't think so, both the server I am trying to ssh into and the PC I am sshing from are on our LAN and the firewall only blocks incoming traffic from outside of our LAN, plus I can ssh into the server if I boot into runlevel 3?? Is there some sort of firewall rules within the O/S that would not be enabled in runlevel 3 but enabled in runlevel 5?

Thanks,

david_ross 06-26-2003 12:46 PM

It is possible that they could be conficured to be different. Why don;t you just look at your rules and see if there are any that would block access.

begacjj 06-26-2003 12:50 PM

I have always used hardware based firewall rules so I am not familiar with where to look in the O/S for the rules. Can you point me in the right direction?

Thanks for all of your help

david_ross 06-26-2003 12:53 PM

It depends if you are using iptables or ipchains - one will give you an error - the other should work:
ipchains -L
iptables -L

begacjj 06-26-2003 01:09 PM

It looks like I am using IPtables.


[root@test sysconfig]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@test sysconfig]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


I couldn't quite make sense of the help file for /sbin/iptables? How do I display and edit the actual rules?

Thanks again for you help

david_ross 06-26-2003 01:15 PM

Those are the rules - you are allowing eveything and denying nothing so that isn't the problem


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