Active Topics

 



Notices


Reply
Thread Tools
Posts: 138 | Thanked: 8 times | Joined on Dec 2009
#1
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.
 
Posts: 75 | Thanked: 125 times | Joined on Nov 2008
#2
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

Last edited by jabawok; 2010-01-16 at 08:21. Reason: tidier
 
Posts: 68 | Thanked: 24 times | Joined on Jan 2010
#3
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.

Last edited by slux; 2010-01-16 at 08:36.
 

The Following 2 Users Say Thank You to slux For This Useful Post:
Posts: 6 | Thanked: 2 times | Joined on Jan 2010
#4
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?
 
zwer's Avatar
Posts: 455 | Thanked: 782 times | Joined on Nov 2009 @ Netherlands
#5
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`.
__________________
Man will never be free until the last king is strangled with the entrails of the last priest.

Last edited by zwer; 2010-01-30 at 20:28.
 
Posts: 486 | Thanked: 251 times | Joined on Oct 2009
#6
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
 

The Following 2 Users Say Thank You to j.s For This Useful Post:
Posts: 6 | Thanked: 2 times | Joined on Jan 2010
#7
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

Last edited by shaq; 2010-01-30 at 21:38. Reason: add something
 
Posts: 6 | Thanked: 0 times | Joined on Feb 2010
#8
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.
 
Posts: 6 | Thanked: 2 times | Joined on Jan 2010
#9
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 ?
 
Posts: 1 | Thanked: 2 times | Joined on Feb 2010
#10
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
 

The Following 2 Users Say Thank You to gmacchi For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:39.