Results 1 to 9 of 9

Thread: how to make sshd start automatically at boot time?

  1. #1
    Member registered user
    Join Date
    Mar 2004
    Posts
    46

    how to make sshd start automatically at boot time?

    From reading the posts in this forum, it seems that
    when you do a hard disk install Knoppix will ask you if you want to:

    Start a Mail Server
    Start sshd at boot?
    Start Samba at boot
    Start KDE at boot?


    I did not see any of this.

    Now that my hard disk install is done, how do I make sshd start automatically at boot time?

    Thanks.

  2. #2
    Senior Member registered user
    Join Date
    Mar 2004
    Location
    Berlin
    Posts
    436
    There is a file prepared for that:
    Code:
    /etc/init.d/ssh
    Run it on boot isn't wise, because you may boot sometimes without networking.
    There are several runlevels, by convention:
    Code:
    S   SingleUser rescue mode (or Superuser?)
    1    Single user without networking
    2    Multi user wo. net
    3    Multiuser + networking (here we need ssh)
    4    ? reserved for special purpose
    5    Multiuser + net + X11 (here too)
    6    Reboot
    ...
    For every level there is a rcX.d - directory, usually in /etc or in a subdir of /etc
    (Replace the X with S, 1...6)
    If you switch the runlevel, for the level you leave its kill-Scripts are called, and for the new, its Start-scripts are called.
    Surprisingly, both scripts, the kill script and the start scripts are identical!
    How's that?
    Well - they are called with a parameter, which they evaluate.
    Code:
    fooManShoe -start
    fooManShoe -stop
    If you switch to runlevel 3 or 5, you need the start-script to be called, and if you leave them, the Kill-scripts should be called.
    Therefore you create a symbolic link from the /etc/init.d/ssh to /etc/rc3.d/S44ssh and to rc5 accordingly.
    The number - 44 in my example, decides the order in which the scripts are called. Lower numbers first.
    I don't know if ssh needs a kill-script, if yes, you would use /etc/rc3.d/K44ssh too.

    There is a graphical tool, which does this in a userfriendly way.
    SysVinit or something similiar.

    In either way, you have to be root to do this.

  3. #3
    Senior Member registered user
    Join Date
    Mar 2004
    Posts
    900
    Well I run sshd on boot on all of my boxes.
    Code:
    update-rc.d ssh defaults
    That ougtta do it.

  4. #4
    Senior Member registered user
    Join Date
    Mar 2004
    Location
    Berlin
    Posts
    436
    ah, that looks much simpler

  5. #5
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    Long Island, NY, USA
    Posts
    1,256
    On my LAN in my classroom, I put

    Code:
    /etc/init.d/ssh -start
    at the end of /etc/bootmisc.sh on all my PCs and all is well!

    Good Luck,
    AJG

  6. #6
    Member registered user
    Join Date
    Mar 2004
    Posts
    46
    I did

    update-rc.d ssh defaults

    and that works.
    Now sshd runs at boot every time.

    Thanks to all of you.

  7. #7
    Senior Member registered user
    Join Date
    Mar 2004
    Posts
    900
    Now to reverse your changes (or halt other startup scripts in /etc/init.d) do:

    Code:
    update-rc.d -f <service> remove
    Example:

    Code:
    update-rc.d -f ssh remove

  8. #8
    Member registered user
    Join Date
    Mar 2004
    Posts
    46
    ok, cool

    so can I use

    update-rc.d apache defaults

    to start apache at boot?

    and

    update-rc.d mysql defaults

    to start mysql at boot?

  9. #9
    Senior Member registered user
    Join Date
    Mar 2004
    Posts
    900
    Quote Originally Posted by lothario
    ok, cool

    so can I use

    update-rc.d apache defaults

    to start apache at boot?

    and

    update-rc.d mysql defaults

    to start mysql at boot?
    Yep. Anything that lives in /etc/init.d can be set to run from any run level you like w/ update-rc.d.

Similar Threads

  1. x-server does not start automatically
    By Mr.45er in forum General Support
    Replies: 2
    Last Post: 10-06-2004, 01:21 AM
  2. How to make apache 1.3 automatically start at boot?
    By Zero_1984 in forum Hdd Install / Debian / Apt
    Replies: 6
    Last Post: 09-28-2004, 04:57 AM
  3. start sshd automatically
    By paradox87 in forum Hdd Install / Debian / Apt
    Replies: 2
    Last Post: 06-16-2004, 11:38 PM
  4. start sshd at boot time
    By lothario in forum General Support
    Replies: 6
    Last Post: 04-29-2004, 09:47 AM
  5. start scripts automatically
    By hokiegal99 in forum General Support
    Replies: 1
    Last Post: 12-11-2003, 01:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


HP ProLiant MicroServer Gen8 G1610T @2.3 GHz, 16GB, 712317-001 NO HDD/OS picture

HP ProLiant MicroServer Gen8 G1610T @2.3 GHz, 16GB, 712317-001 NO HDD/OS

$199.00



Nasuni NF-50 Supermicro Server, Atom CPU C2558, @ 2.40GHz, 8GB RAM-No HDD/OS/AC picture

Nasuni NF-50 Supermicro Server, Atom CPU C2558, @ 2.40GHz, 8GB RAM-No HDD/OS/AC

$250.00



Supermicro CSE-937 3U Storage Chassis No CPU No HDD No Ram Tested & Reset picture

Supermicro CSE-937 3U Storage Chassis No CPU No HDD No Ram Tested & Reset

$129.99



Supermicro 1U Network Server Appliance 16GB RAM 800GB SSD 6 LAN Ports Powers On picture

Supermicro 1U Network Server Appliance 16GB RAM 800GB SSD 6 LAN Ports Powers On

$450.00



Supermicro 2U X10DRU-i 2x E5-2680 v3 2.5ghz 32gb Ram  240gb SSD 2x GPU *READ* picture

Supermicro 2U X10DRU-i 2x E5-2680 v3 2.5ghz 32gb Ram 240gb SSD 2x GPU *READ*

$369.99



New Barebones Supermicro 5019D Server, 4C/8T Xeon D-2123T, 1U Rackmountable, 10G picture

New Barebones Supermicro 5019D Server, 4C/8T Xeon D-2123T, 1U Rackmountable, 10G

$449.99



Supermicro 5019D-4C-FN8TP Xeon D-2123IT (4C/8T) 64GB DDR4 10GbE 480GB 1U Server picture

Supermicro 5019D-4C-FN8TP Xeon D-2123IT (4C/8T) 64GB DDR4 10GbE 480GB 1U Server

$689.00



1U Edge Firewall Server X11SCW-F Xeon E-2174G 0 RAM M.2 NVME 3x PCI-e 2x PSU   X picture

1U Edge Firewall Server X11SCW-F Xeon E-2174G 0 RAM M.2 NVME 3x PCI-e 2x PSU X

$175.00



Supermicro 505-2   Server picture

Supermicro 505-2 Server

$280.00



Supermicro CSE-937 3U Storage Chassis No CPU No HDD No Ram Tested & Reset picture

Supermicro CSE-937 3U Storage Chassis No CPU No HDD No Ram Tested & Reset

$129.99