test: fix exec pty test
test: ensure proper permissions on key files