Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    How to disable ssh on startup?

    Reply
    Page 1 of 2 | 1   2   | Next
    andyph666 | # 1 | 2010-01-16, 03:25 | Report

    Hi there. Was wondering if its possible to disable openssh on startup? On my iphone it took a lot of battery so I'd prefer not to have it open. Also would make it more secure as I rarely have a need for it. Thanks for the help.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jabawok | # 2 | 2010-01-16, 08:17 | Report

    It hasn't made any concievable difference to battery life on my n900 (and it shouldnt). sshd wont wake the cpu out of idle very often at all (unless it recieves a connection).

    But, because you wanted to know, install gainroot then type:
    Code:
    sudo gainroot
    rm /etc/init.d/ssh
    exit
    Reinstall openssh-server to restore the initscript you just deleted.

    Instead of breaking your openssh-server startup, heres a better idea: temporarily stop openssh so u can see how much extra battery time you get (there wont be a difference):
    Code:
    sudo gainroot
    /etc/init.d/ssh stop
    exit
    Hope that helps

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by jabawok; 2010-01-16 at 08:21. Reason: tidier

     
    slux | # 3 | 2010-01-16, 08:28 | Report

    Actually, as Maemo seems to be debian-based the proper way of changing what starts on boot would be:
    Code:
    update-rc.d ssh remove
    as root. This way you won't break the package and can still start and stop the service on demand.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by slux; 2010-01-16 at 08:36.
    The Following 2 Users Say Thank You to slux For This Useful Post:
    DrWilken, jabawok

     
    shaq | # 4 | 2010-01-30, 18:54 | Report

    hello
    i have same problem but the previous posts aren't useful,
    it looks like n900 is not using rc scripts, if i do ....
    /etc/init.d/ssh stop
    the process is being killed but it keep respawn with new process ID.
    any idea how to disable the sshd at startup and use the init scripts instead?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    zwer | # 5 | 2010-01-30, 20:19 | Report

    You can create a file `sshd_not_to_be_run` at /etc/ssh and the deamon won't start automatically. Then whenever you want to run the service just rename / remove the file and call /etc/init.d/ssh start.

    You can also add additional `force-start` option in the /etc/init.d/ssh by duplicating the `start` method and removing its first line (check_for_no_start) so you won't need to remove the file each time you want to start the service.

    edit: here you go: http://www.topflashers.com/maemo/misc/ssh . Overwrite the one in /etc/init.d with this one, and add /etc/ssh/sshd_not_to_be_run file and it will never start automatically. When you want to start it use `/etc/init.d/ssh force-start`.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by zwer; 2010-01-30 at 20:28.

     
    j.s | # 6 | 2010-01-30, 21:19 | Report

    Originally Posted by zwer View Post
    You can create a file `sshd_not_to_be_run` at /etc/ssh and the deamon won't start automatically. Then whenever you want to run the service just rename / remove the file and call /etc/init.d/ssh start.

    You can also add additional `force-start` option in the /etc/init.d/ssh by duplicating the `start` method and removing its first line (check_for_no_start) so you won't need to remove the file each time you want to start the service.

    edit: here you go: http://www.topflashers.com/maemo/misc/ssh . Overwrite the one in /etc/init.d with this one, and add /etc/ssh/sshd_not_to_be_run file and it will never start automatically. When you want to start it use `/etc/init.d/ssh force-start`.
    Nothing on the n900 needs to be altered to stop and start sshd. maemo 5 uses upstart to control services. Configuration files are in /etc/event.d instead of /etc/init.d

    To stop the sshd server daemon, as root, type:r
    Code:
    initctl stop sshd
    To restart a stopped sshd, root, type:
    Code:
    initctl start sshd

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to j.s For This Useful Post:
    pyllyukko, SR90

     
    shaq | # 7 | 2010-01-30, 21:36 | Report

    Originally Posted by j.s View Post
    Nothing on the n900 needs to be altered to stop and start sshd. maemo 5 uses upstart to control services. Configuration files are in /etc/event.d instead of /etc/init.d

    To stop the sshd server daemon, as root, type:r
    Code:
    initctl stop sshd
    To restart a stopped sshd, root, type:
    Code:
    initctl start sshd
    thanks! great
    now i'mn finally able to stop sshd ...
    and how about to configure to not start automatically at system boot?
    i just want to use it when i start it manually
    i didn't find this option in config file

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by shaq; 2010-01-30 at 21:38. Reason: add something

     
    pernacentus | # 8 | 2010-02-06, 18:53 | Report

    Hi shaq, have you found any improvement in battery life after stopping sshd? Because i also think sshd is dropping down my battery level since i didn't have this problem before i installed ssh server.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    shaq | # 9 | 2010-02-09, 19:20 | Report

    hey pernacentus, not yet, i need to stop it manually each time after reboot, but i'm afraid this is not the only application which eats up the battery, i can see sometime quite high cpu utilization by some other ( for me unknown ) system applications, is there any SW for logging the cpu utilization available for maemo ?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    gmacchi | # 10 | 2010-02-11, 22:54 | Report

    Originally Posted by shaq View Post
    thanks! great
    now i'mn finally able to stop sshd ...
    and how about to configure to not start automatically at system boot?
    i just want to use it when i start it manually
    i didn't find this option in config file
    in /etc/event.d edit the related ssh file and comment with # the unneeded:

    Code:
    #start on stopped rcS
    
    console output
    
    #respawn
    
    pre-start script
        if [ ! -d /var/run/sshd ] ; then
            mkdir /var/run/sshd
            chmod 755 /var/run/sshd
        fi
    end script
    
    exec /usr/sbin/sshd -D

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to gmacchi For This Useful Post:
    iHaveNoNames

     
    Page 1 of 2 | 1   2   | Next
vBulletin® Version 3.8.8
Normal Logout