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)

DaveQB 2010-01-04 23:38

Re: disabling ssh server on n900
 
Quote:

Originally Posted by adrianp (Post 453002)
There is the following package in Ubuntu/Debian for this :-
Code:

upstart-compat-sysv - compatibility for System-V-like init
I suspect the idea is to move away from sys-v and just use upstart combined with if-up/down.d for network scripts. Bit confusing for "old-timers" like myself but I'm gradually getting the hang if it.

Thanks.

Yeah I know what you mean. I still have no clue with upstart [yet]

schettj 2010-01-04 23:52

Re: disabling ssh server on n900
 
you could also edit the /etc/ssh/sshd_config file and have sshd listen on some other, more obscure port by changing the line that says

Port 22

to be some other port well about 1024.

Works for me...

JB101 2010-07-13 16:24

Re: disabling ssh server on n900
 
This is most likely a very stupid question - i'm just starting to learn linux so my knowledge is minimal.

I've spent time reading the posts regarding ssh,
got WINSCP installed on an XP machine and successfully connected from the xp machine into the N900.
Even correctly re-jigged the port to a non default one.

Pinging and tracert shows the N900 is correctly registered on my domain
(connecting to the domains wifi)

But, there's always a but.
How from the N900 would I connect to machines on the domain and browse network shares?
This is where my ignorance comes into play .. is this possible
if so is there a step by step idiots guide anywhere?

Any info / advice much appreciated.
Cheers

.. as an addendum to the above, - unrelated.
How would I open say the sshd_config file on the N900?
Is it via xterm? or is the only way as I've already done by copying to my xp machine and using wordpad?

afaq 2010-07-13 16:32

Re: disabling ssh server on n900
 
cant answer the first part but you can edit the sshd_config using midnight commander (from extras i think) straight from ur n900.

JB101 2010-07-16 11:27

Re: disabling ssh server on n900
 
I found the Wizard mounter app - that does the job nicely.
Just connect to the domain on wifi, then map and mount network shares

Works perfectly.

oKtosiTe 2010-08-03 17:30

Re: disabling ssh server on n900
 
Quote:

Originally Posted by adrianp (Post 434433)
It seems sshd is started by upstart so removing the rc2.d link won't work. I know little about upstart but sshd is started from /etc/event.d/sshd so it might be possible to change the exec line to a script :-
Code:

script
        if [ -f /etc/dont_start_ssh ]; then
                exit 1
        else
                exec /usr/sbin/sshd -D
        fi
end script

This is untested but I don't think it will cause any problems with booting the N900 itself, just sshd. Make a backup before trying though; oh and let us know how it goes.

That would work fine, but I'm using "SSH Status and Switcher", an application that lives in the notification area and allows me to switch the SSH server on or off with two simple clicks. With the above fix, said program also fails to start the server.
I think what's needed here is a different condition, say by checking the current runlevel or for a running process, so that starting of the SSH server is only inhibited during the boot process.
I will post back if I learn more.

Edit: I just tried scripting it to check for the current runlevel, but that came back with a permission denied for some reason; it worked fine when executing the same commands manually.

int_ua 2010-09-08 09:36

Re: disabling ssh server on n900
 
installed openssh-server and executed
Code:

cat /etc/init.d/ssh
There is already a function named check_for_no_start() checking if /etc/ssh/sshd_not_to_be_run is existing.
Don't know if creating this file will affect applet. Will try later.

oKtosiTe 2010-09-08 09:57

Re: disabling ssh server on n900
 
Quote:

Originally Posted by int_ua (Post 810427)
installed openssh-server and executed
Code:

cat /etc/init.d/ssh
There is already function, named check_for_no_start() checking if /etc/ssh/sshd_not_to_be_run is existing.
Don't know if creating this file will affect applet. Will try later.

I think I tried that, and I seem to recall that that made the applet not work, but it's been a while ago, so I can't be certain.

int_ua 2010-09-08 12:31

Re: disabling ssh server on n900
 
Quote:

Originally Posted by oKtosiTe (Post 810447)
I think I tried that, and I seem to recall that that made the applet not work, but it's been a while ago, so I can't be certain.

Then someone should ask applet author to add support for such feature and create/delete this file to make changes permanent and reboot-resistant. :rolleyes:

quanttrom 2010-09-10 03:08

Re: disabling ssh server on n900
 
Hello guys,

tonight I had the same issue and with some hints from the #n900 channel I was able to arrive at a quick fix to do what we want it to do... but it's that..a quick hack. Next time you update your packages it will be written over.
Apparently the N900 does not use the SysV init files that we all know and love but it uses upstart

so, to solve our little problem, I simply changed the file responsible for starting ssh

go to /etc/event.d and edit sshd with your favorite UNIX aware text editor.

replace:
Code:

start on stopped rcS
with

Code:

#start on stopped rcS
By commenting it out it won't be started automatically.

That's it. Reboot your phone and all is good.


All times are GMT. The time now is 11:33.

vBulletin® Version 3.8.8