[clug] ssh to box, run shell command, then leave shell open?

Alex (Maxious) Sadleir maxious at gmail.com
Fri Apr 15 01:13:12 MDT 2011


I think the "expect" solution will suffice this time but it should be
noted that you can automatically run commands/scripts based on what
ssh key is used:
eg.
 root at futzy# cat /root/.ssh/authorized_keys
  command="/usr/local/bin/authprogs" ssh-rsa AAAAB3NzaC1yc2EAAAABIwA
  AAIEA3nCnBRQR2x4Ak7I3gS62ASXGiC+5osLmOX5yS894rjFdFEVKgiuhuU0W7NdE
  3Mymkm0oX3oZM1e7NNxDx/4/Cu/4fISP8opwN4GG2wbubZARFyJpWNMcVe8ZdOdmr
  lXFYh49a18i++SScHnycmiL8AmEb06Obrhkc5iAyVnHAf08Lqk=
backups at beepbeep.example.net

from http://www.hackinglinuxexposed.com/articles/20030115.html

On Fri, Apr 15, 2011 at 4:09 PM, Alex Satrapa <grail at goldweb.com.au> wrote:
> Assumptions based on static IP address will come back to bite you in the arse :\
>
> Alex Satrapa | web.mac.com/alexsatrapa | Ph: 0407 705 332
>
> On 15/04/2011, at 8:04, Angus Gratton <gus at projectgus.com> wrote:
>
>> You can get your client machine's IP address from the first field in
>> $SSH_CLIENT, is that always the same?
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux
>


More information about the linux mailing list