maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   disabling ssh server on n900 (https://talk.maemo.org/showthread.php?t=37744)

cgarvie 2009-12-20 09:52

Re: disabling ssh server on n900
 
Quote:

Originally Posted by z3phyr (Post 434271)
sorry i asked this in another thread but no one answered

i want to stop the ssh server to possibly save some power :S

is this particularly battery hungry? as i have installed it. but know i wont use it much

also whats the autostart. is that it restarting on reboot?

z3phyr 2009-12-20 10:04

Re: disabling ssh server on n900
 
Quote:

Originally Posted by cgarvie (Post 435148)
is this particularly battery hungry? as i have installed it. but know i wont use it much

also whats the autostart. is that it restarting on reboot?


im not too sure if its that battery hungry, havn't really noticed.

but the autostart is it automatically runs again once someone tries to connect to it. for paranoid people that are afraid of unauthorized access

Suurorca 2009-12-20 10:10

Re: disabling ssh server on n900
 
Funnily enough, the server doesn't seem to stop for me, even though it returns "service stopped"; ssh localhost still lets me in.

I suppose I should do some research and file a bug report. Some day...

adrianp 2009-12-20 10:22

Re: disabling ssh server on n900
 
Quote:

Originally Posted by Suurorca (Post 435159)
Funnily enough, the server doesn't seem to stop for me, even though it returns "service stopped"; ssh localhost still lets me in.

From an xterminal try :-
Code:

ps -ef | grep sshd
<kill all the processeses>
/etc/init.d/sshd start
/etc/init.d/sshd stop
ps -ef | grep sshd

Does it stop it now - if so it may have been a pid file lying around from earlier. Argh, perhaps it is an interaction between the old and new methods of starting : init.d against upstart. In fact perhaps the above should be just "start sshd; stop sshd" instead of "/etc/init.d/sshd" ?

cgarvie 2009-12-21 17:28

Re: disabling ssh server on n900
 
Quote:

Originally Posted by z3phyr (Post 435156)
im not too sure if its that battery hungry, havn't really noticed.

but the autostart is it automatically runs again once someone tries to connect to it. for paranoid people that are afraid of unauthorized access


i always thought SSH was fairly secure. did i miss something

R-R 2009-12-24 05:20

Re: disabling ssh server on n900
 
Quote:

Originally Posted by Suurorca (Post 435159)
Funnily enough, the server doesn't seem to stop for me, even though it returns "service stopped"; ssh localhost still lets me in.

I suppose I should do some research and file a bug report. Some day...

Code:

HHGTTG:/etc/event.d# cat sshd
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

I've got the same problem, if i kill sshd or do ./sshd stop, it doesn't change anything, i can still connect to ssh... Worst case i get booted but the server is still there.

I'm not used to upstart yet, how am i supposed to disable something without edition the main scripts for a hack? :)

z3phyr 2009-12-24 05:51

Re: disabling ssh server on n900
 
Quote:

Originally Posted by R-R (Post 439992)

I've got the same problem, if i kill sshd or do ./sshd stop, it doesn't change anything, i can still connect to ssh... Worst case i get booted but the server is still there.

I'm not used to upstart yet, how am i supposed to disable something without edition the main scripts for a hack? :)


i think you didnt stop the autostart. the server will automatically run again once someone tries to establish a connection to it.

im pretty sure "rm -f /etc/rc2.d/s55ssh" worked for me the first time before i messed up with the ln command.

if that doesnt work then guess you'll have to try that script

DrWilken 2009-12-31 00:07

Re: disabling ssh server on n900
 
Quote:

Originally Posted by z3phyr (Post 435006)
last night i was playing with the "update-rc.d -f ssh remove" command. it removed some ssh entries. not too sure what that does, hope it don't cause any problems

You removed the following links:
/etc/rc0.d/K20ssh
/etc/rc1.d/K20ssh
/etc/rc.2.d/S55ssh
/etc/rc.3.d/S55ssh
/etc/rc.4.d/S55ssh
/etc/rc.5.d/S55ssh
/etc/rc6.d/K20ssh

Which meant (K)ill ssh at runlevel 0,1 and 6. (S)tart ssh at runlevel 2, 3, 4 and 5). The 55/20 is the order at which ssh is started/stopped (a start script with S40 will be executed before S41, and the same goes for K scripts)... :)

Maemo is apparently using runlevel 2 as "GUI" runlevel (normally it's 5), and 0 is shutdown, 6 is restart (don't mind about the rest). ;)

http://en.wikipedia.org/wiki/Runlevel

They can be added again using this:
Code:

update-rc.d ssh start 55 2 3 4 5 . stop 20 0 1 6 .
;)
Quote:

Originally Posted by z3phyr (Post 435006)
where can i learn what the options means like the -f and -d etc.

From the man page of update-rc.d (on Ubuntu):
EXAMPLES
Insert links using the defaults:
update-rc.d foobar defaults
The equivalent dependency header would have start and stop
dependencies on $remote_fs and $syslog, and start in
runlevels 2-5 and stop in runlevels 0, 1 and 6.
Equivalent command using explicit argument sets:
update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 .
More typical command using explicit argument sets:
update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 .
Insert links at default runlevels when B requires A
update-rc.d script_for_A defaults 80 20
update-rc.d script_for_B defaults 90 10
Insert a link to a service that (presumably) will not be needed by any
other daemon
update-rc.d top_level_app defaults 98 02
Insert links for a script that requires services that start/stop at
sequence number 20
update-rc.d script_depends_on_svc20 defaults 21 19
Remove all links for a script (assuming foobar has been deleted
already):
update-rc.d foobar remove
Example of disabling a service:
update-rc.d -f foobar remove
update-rc.d foobar stop 20 2 3 4 5 .
Example of a command for installing a system initialization-and-shut‐
down script:
update-rc.d foobar start 45 S . stop 31 0 6 .
Example of a command for disabling a system initialization-and-shutdown
script:
update-rc.d -f foobar remove
update-rc.d foobar stop 45 S .

DaveQB 2010-01-03 00:36

Re: disabling ssh server on n900
 
Quote:

Originally Posted by DrWilken (Post 447390)

Maemo is apparently using runlevel 2 as "GUI" runlevel (normally it's 5), and 0 is shutdown, 6 is restart (don't mind about the rest). ;)

It's the Debian way to only use runlevel 2. Red Hat uses runlevel 5 as main runlevel, with varying services starting on the other runlevels.

I don't know why Debian just doesn't use BSD style start up rather than SysV if its only going to use one main runlevel.

DrWilken 2010-01-03 10:06

Re: disabling ssh server on n900
 
Quote:

Originally Posted by DaveQB (Post 450584)
It's the Debian way to only use runlevel 2. Red Hat uses runlevel 5 as main runlevel, with varying services starting on the other runlevels.

I don't know why Debian just doesn't use BSD style start up rather than SysV if its only going to use one main runlevel.

Thanks for educating me... ;)


All times are GMT. The time now is 17:46.

vBulletin® Version 3.8.8