Você pode alterar o shell de usuários (em /etc/passwd ) para um shell personalizado ...
Exemplo simples:
#!/bin/bash
php somefile.php # You might need to give the full path to the php-bin.
bash -r -c read
Salve em /bin , adicione-o a /etc/shells e torne-o executável. O usuário ainda pode usar SCP e SFTP, mas quando ele tenta abrir um shell, o php será executado. Se ele entrar, o shell será fechado.