Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Entries from 2021-01-17 to 1 day

sshのauthorized_keysのcommandでパイプは使えるか

authorized_keysのcommand=オプションにパイプを含むコマンドを指定できるか実験。 command="find /home/satob -maxdepth 1 -name '*.sh' | xargs grep '#!'" ssh-ed25519 AAAAC3Nz... pipe@example.com 実行してみたらこんな感じ。問題なく実行できた。結局…

rbashでディレクトリトラバーサルは防げない

satob.hatenablog.com で挙げた # cat authorized_keys command="ls /$SSH_ORIGINAL_COMMAND" ssh-rsa AAAAB.... $ ssh root@xxx.xxx.xxx.xxx -i ~/.ssh/com "tmp;hostname" ls: /tmp;hostname: No such file or directory みたいなケースで$SSH_ORIGINAL_CO…