Kirjoittaja Aihe: Kuinka käynnistää Debianissa sshd:n automaattisesti?  (Luettu 2343 kertaa)

kamara

  • Käyttäjä
  • Viestejä: 2951
    • Profiili
Mulla pyörii sshd Raspberry Pi:ssä, muttei se käynnisty automaattisesti koneen käynnistämisen yhteydessä.

Mihinkä pitää laittaa sen käynnistymisscripti.

Koodia: [Valitse]
#/etc/init.d/ssh restart

kamara

  • Käyttäjä
  • Viestejä: 2951
    • Profiili
Vs: Kuinka käynnistää Debianissa sshd:n automaattisesti?
« Vastaus #1 : 07.08.12 - klo:15.27 »
Löysin ohjelman sysv-rc-conf, jolla pystyneen laittaa palveluja käynnistymään, mutta mille kaikille tasoille kannattaa laittaa?

Kone toimii siis tekstipohjaisena serverinä.

kamara

  • Käyttäjä
  • Viestejä: 2951
    • Profiili
Vs: Kuinka käynnistää Debianissa sshd:n automaattisesti?
« Vastaus #2 : 07.08.12 - klo:15.38 »
Ei taida toimia ihan niin kuin haluaisin.  :'(

kamara

  • Käyttäjä
  • Viestejä: 2951
    • Profiili
Vs: Kuinka käynnistää Debianissa sshd:n automaattisesti?
« Vastaus #3 : 07.08.12 - klo:16.31 »
Löytyi ainakin jonkinlainen purkkaratkaisu.

Muutin /etc/rc.local:n seuraavanlaiseksi:
Koodia: [Valitse]
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# But locally (for BCM 2835 ARM Linux) we...

_firstboot=false

# assume there is no /etc/hostip until we have run at least once
if [ ! -f /etc/hostip ]; then
    # once-off initialization
    echo "Welcome to Raspberry Pi - one-off initialization"
    [ -x /sbin/ldconfig ] && /sbin/ldconfig
    [ -x /sbin/insserv ] && /sbin/insserv networking 2>/dev/null
    _firstboot=true
fi

if [ -x /boot/boot.rc ]; then
    # note the user could easily try to make or edit this file in Windows
    # this will give it the wrong line endings and may result in errors
    # we try to discourage this my not making it a .txt file
    . /boot/boot.rc
fi

# show the main IP address late enough in the start-up sequence for people
# to read it e.g. to be able to ssh to the system
if hostname -I > /etc/hostip; then
    _IP=`cat /etc/hostip`
    [ -z "$_IP" ] || echo "My network IP address is $_IP"
    /etc/init.d/ssh start
fi

if ${_firstboot}; then
    # Experience suggests that we are in a mess on the first boot
    # (Something (ifplugd?) prevents the loopback network interface comming up)
    echo "Raspberry Pi rebooting... "
    echo "-- If we stop waiting for portmap feel free to turn the power off"
    echo "   and on again"
    echo "-- (only on this reboot occasion - it is normally better to wait)"
    echo "see you later."
    reboot
fi

exit 0

Eli lisäsin siihen yhden rivin:
Koodia: [Valitse]
    /etc/init.d/ssh start

Postimies

  • Käyttäjä
  • Viestejä: 2619
    • Profiili
Vs: Kuinka käynnistää Debianissa sshd:n automaattisesti?
« Vastaus #4 : 05.09.12 - klo:19.59 »
En nyt menisi noita muuttelemaan.... Muistaakseni noi demonit Debian starttaisi automaattisesti. Jos ei kokeile update-rc.d tai dpkg-reconfigure ssh.  /etc/rc.local ei ole paikka systeemin demoneille. Ei ole nyt Debinia käsillä, enkä muista sen ajotasoja. Gentoossa homma hoituu rc-update komennolla. Ks. man update-rc.d. Mitkä palvelut käynnistyy bootissa hallitaan ihan kometorivillä ei init scriptejä muokkaamalla jotka päivityksen yhteydessä taas muokkautuvat.

_Pete_

  • Käyttäjä
  • Viestejä: 1836
  • Fufufuuffuuu
    • Profiili
Vs: Kuinka käynnistää Debianissa sshd:n automaattisesti?
« Vastaus #5 : 06.09.12 - klo:10.55 »
Kunhan paketti openssh-server on asennettu sshd käynnistyy itsestään bootissa.