SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Running Slackware 15 and find that sshd is not starting at boot time, despite /etc/rc.d/rc.sshd being executable and I've not modified /etc/rc.d/rc.inet2
The rc.sshd script is a very simple one It checks for, or generates keys then starts the daemon. Also check the conf file. The commented lines are program defaults - it's the other ones you want to watch
Not enough information. With init4 the OP could be starting NM from the GUI which is later in the startup process. That could impact all sorts of network issues.
Odd.. How do you know it's not running? Can't connect to it remotely??
Chuck56 does have a point, though the NetworkManager issue impacts run level 3 as well.
The issue being that even though the service is running, a connection can't be made to the PC until a user logs in.
This is because until login, the network interface can be inactive.
If you would, reboot your PC
When it comes up, log in and open a console
at your prompt type:
Code:
ps ax | grep 'sshd'
and press enter
Please copy/paste the result (or upload a screenshot of it)
I also don't recall using NM much before with Slackware, as I generally use it only for server purposes and init 3 with manual network settings, so this could be the issue?
Yes, ps aux | grep 'sshd' tells me it's not running, together with not being able to connect from other hosts or even to itself. Manually starting resolves but of course that is not the issue.
As an aside, I'm also finding the same with ntpd, it is also not starting at boot time, but again can start manually.
There's also an init script utility that comes with networkmanager that is very little talked about. Is it nm-tui? Whatever it is, I tried it and it works, but it mightn't be called soon enough in rc.M
One possible reason that your startup scripts are unable to start sshd could be that you are using networkmanager to give your machine an IP address after the startup scripts are done and that you have put that ip address instead of 0.0.0.0 as ListenAddress in /etc/ssh/sshd_config.
-f config_file
Specifies the name of the configuration file.
The default is /etc/ssh/sshd_config.
sshd refuses to start if there is no configuration file.
One possible reason that your startup scripts are unable to start sshd could be that you are using networkmanager to give your machine an IP address after the startup scripts are done .....
For services which depend on network being available, I have a script in /etc/NetworkManager/dispatcher.d/ which waits for network to be up before starting the service. For OP's case, try something like:
Code:
# Delay sshd daemon till network available
IF=$1
STATUS=$2
if [ "$IF" = "wlan0" ]; then
case "$2" in
up)
logger "Network Manager UP triggered on $IF - starting sshd"
/etc/rc.d/rc.sshd stop
sleep 1
/etc/rc.d/rc.sshd start
;;
*)
logger "Network Manager $STATUS triggered on $IF"
;;
esac
fi
Change network target as desired (wlan0 above). Keep it as something like /etc/NetworkManager/dispatcher.d/sshd and make it executable.
For services which depend on network being available, I have a script in /etc/NetworkManager/dispatcher.d/ which waits for network to be up before starting the service. For OP's case, try something like:
Code:
# Delay sshd daemon till network available
IF=$1
STATUS=$2
if [ "$IF" = "wlan0" ]; then
case "$2" in
up)
logger "Network Manager UP triggered on $IF - starting sshd"
/etc/rc.d/rc.sshd stop
sleep 1
/etc/rc.d/rc.sshd start
;;
*)
logger "Network Manager $STATUS triggered on $IF"
;;
esac
fi
Change network target as desired (wlan0 above). Keep it as something like /etc/NetworkManager/dispatcher.d/sshd and make it executable.
chris
Sorry, but the network is not required for sshd to start.
edit: as long as your listenaddress is 0.0.0.0 (maybe? have not tested it) nope
Sorry, but the network is not required for sshd to start.
edit: as long as your listenaddress is 0.0.0.0 (maybe? have not tested it) nope
So you tested to start sshd with a listenaddress which not yet were up? I thought sshd then would be unable to bind to that address, but I haven't tried it myself.
So you tested to start sshd with a listenaddress which not yet were up? I thought sshd then would be unable to bind to that address, but I haven't tried it myself.
regards Henrik
How sshd can know an interface is up ? e.g. if you put: ListenAddress 0.0.0.0
It works the same way that AllowUsers or AllowGroups
If the specified user or group does not exist, you just can't connect. Is does not check if that user/group exists
How sshd can know an interface is up ? e.g. if you put: ListenAddress 0.0.0.0
It works the same way that AllowUsers or AllowGroups
If the specified user or group does not exist, you just can't connect. Is does not check if that user/group exists
The address 0.0.0.0 is a special case as that is known as the "any address", so specifying 0.0.0.0 will make ssh listen on any current or future IP address the machine has.
However, specifying another IP address than 0.0.0.0 might cause trouble if that address is not assigned to the machine when ssh (or any other application) tries to bind its listening socket to that address.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.