den SSH-Weg habe ich auch probiert:
auf dem Host sieht meine authorized_keys so aus:
1 2 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDgH7JI+XM7+hMtxIAx4RvzaHidhavfzfW5l/C6tYL... command="/home/frank/hostinfo.sh" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCvhQzir... |
vorher habe ich natürlich den pubkey ausprobiert
1 | ssh frank@192.168.0.10 -i ~/.ssh/id_rsa_cmd /home/frank/hostinfo.sh info |
1 2 3 4 5 6 7 8 9 10 11 12 13 | #!/bin/bash line=$1 #read line case $line in "info") hostname ;; "exit") echo "goodbye" ;; esac |
funktioniert ohne die Modifikation der authorized_keys...mit kommt keine Ausgabe...ich vermute, es liegt an dem parameter...kann ich einen Parameter an das Script übergeben?
ich habe es jetzt nicht via Parameter gemacht sondern mit read...damit scheint es zu funktionieren:
1 | echo "info" |ssh frank@192.168.0.10 -i ~/.ssh/id_rsa_cmd /home/frank/hostinfo.sh |