RE: Running a user command instead of shell in sshd

From: Sumit Malhotra (smalhotra_at_burgundyinfotech.com)
Date: 06/17/03

  • Next message: exon: "RE: Running a user command instead of shell in sshd"
    Date: Tue, 17 Jun 2003 10:56:42 +0530
    To: "Anurag Bhatia" <Anuragb@ami.com>, "SSH list" <secureshell@securityfocus.com>
    
    

    Anurag,

    Well that can be accomplished in many ways.
    1) By command aliasing on the host side (from where u are executing ssh)
    2) Entry inside the .bashrc of the host side
    3) Running a script as daemon which checks whether a ssh session is
    opened from the host IP

    Still, I didn't get the need for doing so ......
    e.g. ssh 192.168.1.65 poweroff ---> Will poweroff the machine
    192.168.1.65 after authentication.

    -Regards,
    Sumit

    -----Original Message-----
    From: Anurag Bhatia [mailto:Anuragb@ami.com]
    Sent: Monday, June 16, 2003 7:14 PM
    To: Sumit Malhotra; SSH list
    Subject: RE: Running a user command instead of shell in sshd

    Hi,
    I know that if the command name is given while contacting server, it's
    executed on server.
    What if I don't want to specify any command name when running ssh?
    I just want to do "ssh <IP>" and instead of running shell, a command is
    excuted on server.
    Any links????
    Regards,
    Anurag

    -----Original Message-----
    From: Sumit Malhotra [mailto:smalhotra@burgundyinfotech.com]
    Sent: Monday, June 16, 2003 1:53 AM
    To: Anurag Bhatia; SSH list
    Subject: RE: Running a user command instead of shell in sshd

    Hi anurag ,

    The ssh syntax is this :

    ssh username@<machine name of IP> <command to be exceuted at the remote
    end>

    If the command is not given it request for shell.

    -regards,
    Sumit

    -----Original Message-----
    From: Atanas Dimitrov [mailto:atanas_dimitrov@bobcat.gcsu.edu]
    Sent: Saturday, June 14, 2003 10:23 AM
    To: Anurag Bhatia; SSH list
    Subject: Re: Running a user command instead of shell in sshd

    It is refering to an actual scenario when
    "the client either requests a shell or execution of a command"
    The case when the client is requesting ae execution command is specified
    by
    the client so you should be using "man ssh" for more info on this
    feature
    which is the encrypted version of the rsh remote commmand execution.

    :-)

    On Friday 13 June 2003 05:33 pm, Anurag Bhatia wrote:
    > Hi all,
    > "man sshd" talks about ssshd starting user's shell or COMMAND after
    login
    > process is successsful.
    > Where can we specify whether to run user's shell or any other command?
    >
    > Regards,
    > Anurag Bhatia


  • Next message: exon: "RE: Running a user command instead of shell in sshd"

    Relevant Pages

    • Re: ksh silently ignores function if mistakenly not autoloaded
      ... Here's the order of execution. ... This really takes place prior to command ... Shell scripts, with all their power, have one major drawback - they ... In the Korn Shell, there are two separate syntaxes for defining ...
      (comp.unix.shell)
    • Re: Execute and lock a user into a program upon login
      ... logs in to the box via SSH, a command is run, and they immediately get ... dropped into the environment that the command produces. ... user is dropped into the application 'vtysh' ... shell drops (ie. user does not have to exit the csh shell to drop the ...
      (freebsd-questions)
    • Re: Execute and lock a user into a program upon login
      ... logs in to the box via SSH, a command is run, and they immediately get ... dropped into the environment that the command produces. ... user is dropped into the application 'vtysh' ... shell drops (ie. user does not have to exit the csh shell to drop the ...
      (freebsd-questions)
    • Re: tcsh is better for interactive use (Was: Bash command via ssh)
      ... In 1994 I was working on plenty of systems that didn't have bash or tcsh. ... The problem is that you need two useful ways of invoking a command ... Though that would be somewhat of a hack, ssh could simply make this distinction ... shell code, two or more arguments are strings to be passed to execv. ...
      (comp.unix.shell)
    • Re: using ssh to run remote commands? [ssh -T, scp/ssh flags]
      ... I use SSH to forward connections between an intranet server at home and my ... To do this, the user on the remote machine need not have a shell, either ... start a shell on the remote host, ... you can have ssh run a command instead of an interactive shell by ...
      (FreeBSD-Security)