[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh and running command



On  0, Patrick Hsieh <pahud@ezplay.tv> wrote:
> Hello list,
> 
> I'd like to execute a certain command upon someone connect to my server
> with "ssh robot@my.domain.name". I will not authenticate the visitor in
> the ssh session, that is, anyone can do "ssh robot@my.domain.name" in
> order to execute my self-defined command or shell script. Is there any
> way to configure ssh to achieve this? Additionally, If the
> self-defined command or shell script is pertty easy, say, 
> 
> #!/bin/sh
> 
> export PATH=/bin:/usr/bin && \
> echo "Hello there!" && exit 0;
> 
> 
> Is there also security problem?

Does you need to be able to log in to the 'robot' account?  If not,
set the shell of this account to the script you want run and set its
password to an expty string.  I think ssh will then allow a
passwordless login, execute that script and exit.  I'd test it in a
trusted environment, first, though.

Tom
-- 
Tom Cook
Information Technology Services, The University of Adelaide

"If your  company is not involved in something called "ISO 9000" you
probably have no idea what it is.  If your company _is_ involved in ISO
9000 then you definitely have no idea what it is."
	- Scott Adams - The Dilbert principle

Get my GPG public key: https://pinky.its.adelaide.edu.au/~tkcook/tom.cook-at-adelaide.edu.au

Attachment: pgpeo3_HwDYas.pgp
Description: PGP signature


Reply to: