Active Topics

 



Notices


Reply
Thread Tools
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#1
https://gitorious.org/n900-ssh-statu...ssh-status-tmp
http://maemo.org/downloads/product/Maemo5/ssh-status/
http://maemo.org/packages/view/ssh-status/
https://garage.maemo.org/projects/ssh-status/

To prevent sshd from starting comment/remove "start on ..." line from /etc/event.d/sshd


It's almost perfect as it is in 0.1-9 but I wanted to add just one more line to the stopping code:
Code:
killall sshd
Which should kill any active connection also. Any objections?

I've contacted Andrei and he said he wouldn't mind me uploading a new version.

Last edited by int_ua; 2014-01-12 at 01:49.
 

The Following 10 Users Say Thank You to int_ua For This Useful Post:
Posts: 1,163 | Thanked: 1,873 times | Joined on Feb 2011 @ The Netherlands
#2
Yes please
__________________
N900 loaded with:
CSSU-T (Thumb)
720p recording,
Pierogi, Lanterne, Cooktimer, Frogatto
N9 16GB loaded with:
Kernel-Plus
--
[TCPdump & libpcap | ngrep]
--
donate
 

The Following User Says Thank You to mr_pingu For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#3
@int_ua
If you are already on it, would you mind to insert a config (e.g. simple and easy check for presence of file [enable: touch ssh_on_reboot]) to have ssh aauto started after reboot?
Since some version, it was disabled. I made me a workaround (I cannot remember right now ) to have ssh on automatically after boot.

Regarding your question:
this would kill also outgoing self-established connections? Then against it.
Or just the listening daemon (with all incoming connections)? Then agreed.
But I could also imagine there are use cases to stop the daemon to disable further incoming connections, but keep the already existing alive.
So better wait for more input.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#4
Originally Posted by peterleinchen View Post
check for presence of file [enable: touch ssh_on_reboot]) to have ssh aauto started after reboot?
Since some version, it was disabled. I made me a workaround (I cannot remember right now ) to have ssh on automatically after boot.
Yes I'll try. Please add your workaround here for anyone else till I get to it.
Originally Posted by peterleinchen View Post
there are use cases to stop the daemon to disable further incoming connections, but keep the already existing alive.
That's a very good point... Looks like it needs a separate button.
 

The Following 2 Users Say Thank You to int_ua For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#5
Sorry for late reply, but I needed to check a few things and tried to remember, what I had done.
I remember to have checked some sources, but to no avail (two? years ago?). And found that a simple one-liner '/sbin/initctl start sshd' in one of my customization init scripts did the trick. One negative downside is that sshd status ui does show 'status off' after reboot, but actually it's status is on (something I could/can live with).


Code:
description "starting my own mounts and swaps"

author "peterleinchen"

#start on MOUNTS_OK
start on started ke-recv
stop on starting shutdown

console output
env logFile=/dev/null
#env logFile=/home/user/.out_mystart


pre-start script

if [ -f $logFile.3 ]
then
  rm $logFile.3
fi
  if [ -f $logFile.2 ]
  then
    mv $logFile.2 $logFile.3
  fi
    if [ -f $logFile.1 ]
    then
      mv $logFile.1 $logFile.2
    fi
      if [ -f $logFile ]
      then
        mv $logFile $logFile.1
      fi

echo prestart `date` >> $logFile

# mmc(s) should be mounted after ke-recv has started, but currently
# started notification seems to be emitted before it's actually ready.
# this is a temporary workaround, we should fix this in ke-recv or c-r
# properly.
# peterleinchen:
#	sleep 4
# under heavy startup conditions (lots of daemons installed)
# our N900 (ke-recv daemon) may/will need more than 4s, so I used 30s
##	sleep 30
# but now I will check for eMMC and/or SD to be mounted
	sleep 4
	
end script


script

echo start `date` >> $logFile

  # start up ssh server
echo start up SSH server >> $logFile
  initctl start sshd
  
end script
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2013-09-28 at 19:11. Reason: added script (partly)
 

The Following User Says Thank You to peterleinchen For This Useful Post:
nokiabot's Avatar
Posts: 1,974 | Thanked: 1,834 times | Joined on Mar 2013 @ india
#6
keep going
 
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#7
Originally Posted by peterleinchen View Post
to have ssh aauto started after reboot?
Since some version, it was disabled.
Actually, why wouldn't it start?
http://talk.maemo.org/showpost.php?p...6&postcount=12
Now I think it's not the task for this package after all, it's just status and switcher.

Last edited by int_ua; 2013-10-05 at 20:40.
 
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#8
@int_ua
Dumb me checked the debian control file just after removing/rebooting (sshd DID start) and/but after reinstalling/reboot (did NOT start) to check once again:
Maemo-Upgrade-Description: NEW: SSH service switch OFF on start up
Maemo-Upgrade-Description-Ru_ru: Новое: SSH сервис выключается при запуске
And it is like described. So you need to check once more to get it. I did not see anything in the deb package to prevent sshd get started, so it must be included in the sources.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2013-10-01 at 18:48. Reason: correction
 

The Following User Says Thank You to peterleinchen For This Useful Post:
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#9
Originally Posted by peterleinchen View Post
check once again
Indeed, thanks, it's in the C code, plain
Code:
system("sudo /usr/sbin/ssh-status.sh stop")
I'll move it to the postinst script since all the previous users may be still wanting this functionality.

Currently I'm having troubles working with SDK being unable to work with sudo even after replacing it with fakeroot.
http://maemo.org/community/maemo-dev...ysklogd_fails/

Update:
But sshd just ignores whole /etc/init.d/ssh on the start making /etc/ssh/sshd_not_to_be_run pointless. See /etc/event.d/sshd

Update 2: I've sent a mail to the maintainer

Last edited by int_ua; 2013-10-05 at 20:41.
 

The Following 2 Users Say Thank You to int_ua For This Useful Post:
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#10
Update: there are some files that weren't added to git, working on it.

FTBFS.
I've started with removing the code that stops sshd and fixing openssh-server that inores /etc/ssh/sshd_not_to_be_run but it failed to build with
make: *** No rule to make target `configure', needed by `config.status'. Stop.
and it's from debian/rules while I didn't change them yet. Feel free to point what's wrong there:
https://garage.maemo.org/builder/fre...-status_0.2-0/
Code: https://gitorious.org/n900-ssh-statu...ssh-status-tmp
Command that I've used (on N900):
Code:
$ dpkg-buildpackage -sa -S -d -I.git -rsudo

Last edited by int_ua; 2013-10-05 at 20:41.
 
Reply


 
Forum Jump


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