3

Is it possible to ssh to a machine as a user with no valid shell (say, mail)? So far I cannot, and using the command below doesn't work:

$ ssh [email protected] /bin/bash

It will always say "This account is currently not available.". But if I'm logged-in to the machine and use 'su'

$ su mail -s /bin/bash

I can become user mail.

0

1 Answer 1

5

The command passed to ssh is run by the shell on the server, so if no valid shell is specified then it is not possible to run it.

4
  • @Ignacio: Makes sense...but are there any known workaround to this?
    – icasimpan
    Commented Mar 18, 2011 at 9:37
  • 1
    You could use a key and put an entry in ~/.ssh/authorized_keys to allow executing a different command.
    – Ignacio Vazquez-Abrams
    Commented Mar 18, 2011 at 9:38
  • 1
    @Ignacio: I fail to see how adding another way to authorize a user changes the shell being launched on login. And if mail has no $HOME, where would you put a key?
    – alex
    Commented Mar 18, 2011 at 15:28
  • @Alex: mail has a $HOME it's /var/spool/mail. So I tried @Ignacio's suggestion to put an ssh key but it's not being accepted by the server.
    – icasimpan
    Commented Mar 23, 2011 at 4:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .