Re: sudo syntax

From: Bill Campbell (freebsd_at_celestial.com)
Date: 08/27/04

  • Next message: Kevin D. Kinsey, DaleCo, S.P.: "Re: Messed up port updating (Was Re: Updated to 4.10, now portupgrade?)"
    Date: Thu, 26 Aug 2004 16:07:33 -0700
    To: freebsd-questions@freebsd.org
    
    

    On Thu, Aug 26, 2004, David Bear wrote:
    >I want to run a command
    >
    >tar czf - / | ssh id@somehost dd of=tarball.tgz
    >
    >I need to run tar as root. However, I need to run ssh as user 'id'.
    >
    >I tried
    >
    >sudo tar czf - / | ssh id@somehost dd of=tar.tgz
    >
    >but am unsure if ssh was launched as 'id' or as root.

    Everthing to the left of the pipe symbol is one process (e.g. sudo), the
    process to the right is independent of that, and will run as the normal
    user.

    >Any way to be certain that sudo is doing what I want?

    You could do something like this if you want to see it which would display
    the output of id before starting the right side ssh command.

            sudo tar czf - / | ( id ; ssh id@somehost dd of=tar.tgz )

    Bill

    --
    INTERNET:   bill@Celestial.COM  Bill Campbell; Celestial Systems, Inc.
    UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
    FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
    URL: http://www.celestial.com/
    ``It is surprising how much new stuff users find that developers never do.
    You put a copy in front of a normal user and they find all these bugs that
    you would think developers would find. The real users and developers are
    completely different species as far as I am concerned.''
        --Linux creator Linus Torvalds
    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
    

  • Next message: Kevin D. Kinsey, DaleCo, S.P.: "Re: Messed up port updating (Was Re: Updated to 4.10, now portupgrade?)"

    Relevant Pages

    • Re: scp non root
      ... I often see people advise to disable root ssh login access. ... The scp command is "okay" but not a great command. ... I highly recommend using rsync for copies across ...
      (Debian-User)
    • Re: HowTo Disable execution of commands whit ssh and scp/sftp
      ... > give you a fair slice of the password file in a different form. ... > a limited set of commands as root. ... command, and only that one! ... # ssh sshuser@localhost ...
      (Fedora)
    • Re: How to start a daemons remotely using ssh
      ... First of all I am new to ssh and linux security however I just ... I am thinking that using ssh to connect to the machine and then use ... Thousands of people use remote ssh command line access for this sort ... you often need to be root to do these config changes. ...
      (comp.security.ssh)
    • Re: [opensuse] errant who behavior
      ... determine if someone has previously broken into a system via ssh... ... remote root logins were disabled and a weak password replaced... ... Try the "w" command and see what it returns. ... type alias to make sure the an alias has not been introduced into the ...
      (SuSE)
    • RE: Linux hacked
      ... Also, what exactly did the history file show, can you paste it into a mail ... > First let me say I'm a security novice. ... > been unsuccessful in getting root back. ... > via ssh but you could su in once logged in as one of three users. ...
      (Security-Basics)