Notices


Reply
Thread Tools
Posts: 104 | Thanked: 10 times | Joined on Dec 2009
#1
sorry i asked this in another thread but no one answered

i want to stop the ssh server to possibly save some power and increase security

i learnt to root and "/etc/init.d/ssh stop" to stop the server. i know that works because it said ssh stop

then i tried "rm -f /etc/rc2.d/s55ssh" to stop it for autostarting. that worked because i tried to connect but couldnt.

and then finally i tried "ln -s /etc/rc2.d/s55ssh -> /etc/init.d/ssh" incase i wanted the autostart function back. dont know if that works because he said it would need a restart.

now i dont know if any of it works anymore because i don't get the ssh stop message when trying to stop it. and offcourse the server doesnt stop.
i tried restarting and trying it again but still don't work

could the last command i entered stuffed it up?

one more thing. my phone acted pretty strange when trying to type this. the browser would just dissappear when im almost finished typing or would go to a different page. i tried to type this 3 times now before giving up and type it on my computer... scary :S
 
fnordianslip's Avatar
Posts: 670 | Thanked: 359 times | Joined on May 2007
#2
I think your ln command is the wrong way around. It's:
ln -s target link_name
__________________
Class .. : Lame hacker & beardy boffin
Humour . : [#######---] Alignment: Apathetic anarchist
Patience : [####------] Weapon(s): My cat, my code.
Agro ... : |#---------] Relic(s) : N900, MacBookPro, NSLU2, N800, SheevaPlug, Eee-901, Core2-Quad, PS3
"In theory, theory and practice are the same. In practice, they're not."
--
Beware of extras-devel.
 

The Following User Says Thank You to fnordianslip For This Useful Post:
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#3
If you typed it in exactly as you've shown it here, you've wiped out the original /etc/init.d/ssh file (by redirecting an error message to it). You'd best uninstall openssh server, make sure /etc/init.d/ssh is deleted, then reinstall.

EDIT: In fact, the error should go to stderr rather than stdout, so you'd just have truncated the init file.

Last edited by Rob1n; 2009-12-19 at 10:59. Reason: Correction
 

The Following User Says Thank You to Rob1n For This Useful Post:
Posts: 104 | Thanked: 10 times | Joined on Dec 2009
#4
thanks il try that
 
Posts: 236 | Thanked: 223 times | Joined on Oct 2009 @ NE UK
#5
z3phyr: Really sorry about that duff ln -s command... That was from one of my posts I think (I fixed it now) Too much cut and paste, I'm afraid.. I had just pasted in the output of ls -l on the link and meant to go back and turn it into the command, but only got halfway. Mea culpa!

I'm attaching my own /etc/init.d/ssh file (I renamed it ssh.txt so I could upload it)

It should be the same as what that command wiped out, so you could just put it in place and then run the

ln -s /etc/init.d/ssh /etc/rc2.d/s55ssh command (or whatver it was )
Attached Files
File Type: txt ssh.txt (1.8 KB, 214 views)

Last edited by kwotski; 2009-12-19 at 11:33.
 
Posts: 104 | Thanked: 10 times | Joined on Dec 2009
#6
Originally Posted by kwotski View Post
z3phyr: Really sorry about that duff ln -s command... That was from one of my posts I think (I fixed it now) Too much cut and paste, I'm afraid.. I had just pasted in the output of ls -l on the link and meant to go back and turn it into the command, but only got halfway. Mea culpa!

I'm attaching my own /etc/init.d/ssh file (I renamed it ssh.txt so I could upload it)

It should be the same as what that command wiped out, so you could just put it in place and then run the

ln -s /etc/init.d/ssh /etc/rc2.d/s55ssh command (or whatver it was )

its okay. still learnt something. i tried putting in your ssh file but now when i try stopping it i just get permission denied
 
Posts: 236 | Thanked: 223 times | Joined on Oct 2009 @ NE UK
#7
yep, you'll need to do

chmod 755 /etc/init.d/ssh

to give it the 'execute' permission

also there's a better way of controlling startup scripts.. I'm pretty sure it's mentioned later on in the thread where you got my bogus ln command

Last edited by kwotski; 2009-12-19 at 13:15.
 

The Following User Says Thank You to kwotski For This Useful Post:
Posts: 32 | Thanked: 9 times | Joined on Nov 2009 @ Norway
#8
Originally Posted by z3phyr View Post
i want to stop the ssh server to possibly save some power and increase security

i learnt to root and "/etc/init.d/ssh stop" to stop the server. i know that works because it said ssh stop

then i tried "rm -f /etc/rc2.d/s55ssh" to stop it for autostarting. that worked because i tried to connect but couldnt.
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.
 

The Following User Says Thank You to adrianp For This Useful Post:
Posts: 104 | Thanked: 10 times | Joined on Dec 2009
#9
Originally Posted by adrianp View Post
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.

yeah it works. thanks alot. everything working okay by the looks of it.

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

where can i learn what the options means like the -f and -d etc.
 
Posts: 32 | Thanked: 9 times | Joined on Nov 2009 @ Norway
#10
Originally Posted by z3phyr View Post
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

where can i learn what the options means like the -f and -d etc.
man update-rc.d on a Linux box or google for it:-
Code:
update-rc.d - install and remove System-V style init script links
Given upstart doesn't use system-v links (rc2.d etc.) unless the upstart-compat-sysv is installed then it is of little use on a N900.
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:05.