3

Is there any way to get sshd to run an executable without first starting a shell?

The problem is that I accidentally moved libtermcap on a server (which is running CentOS 5). I can't ssh to the machine as bash needs libtermcap. I can't run a command remotely as sshd uses the shell to parse the command. Is there any way round this or do I have to get the server people to boot into recovery and move it back?

1 Answers1

0

I don't know about CentOS, but a lot of unix-like systems have a statically linked shell at /bin/sh so you could try ssh username@hostname /bin/sh command-to-move-backlibtermcap which will exec the executable at /bin/sh with the command rather than attempt to load a login shell (which as you have pointed out will fail when the login shell depends on libtermcap).