Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have problems calling a remote command by different users on different machines. This remote command shall be executed on one single machine and the rsh-session shall be terminated immediately after successful execution of this command. Multiple users can execute this command at the same time.

I know that rsh is insecure, but this isn't an issue here.

My problem here is the configuration of the remote system in regard to privileges and location of the script.

Locally, the rsh command is simply called like this:

rsh $HOST -l $USER remote_command

Some concrete questions here:

  • Do I need a special user ($USER) unlike root to execute the remote command?
  • Which privileges should this user have?
  • Only the privileges to execute the necessary commands and read and write the files that this commands use?
  • In which directory should the script be located? I would place it in /usr/bin, but I don't know if that's a good idea.
share|improve this question
    
Don't put your scripts in /usr/bin, use /usr/local/bin instead. –  gniourf_gniourf Nov 17 '12 at 16:41
add comment

migrated from stackoverflow.com Nov 18 '12 at 12:05

This question came from our site for professional and enthusiast programmers.

1 Answer

As you seem think that security does no matter there,

Some concrete answer:

  • Do I need a special user ($USER) unlike root to execute the remote command?

    Technicaly no, (regardless of security consideration.)

  • Which privileges should this user have?

    The privilege level required are only depending on what remote_command have to do.

  • Only the privileges to execute the necessary commands and read and write the files that this commands use?

    So if all concern script and files at same conceptual level, I think the better way is to create an unprivileged user, with his home directory and put all files and script under this home directory.

  • In which directory should the script be located?

    The best place is $HOME/bin/ (ensuring $HOME/bin is added to your $PATH variable, from your .bashrc or .profile.), the second best place, if this script have to be accessed by other users on same machine is /usr/local/bin (as this path is by default in standard $PATH assignation.

share|improve this answer
    
Thank you. Security isn't really important, because in my case, rsh shall only be used within a trusted network. However, the privileges should be restricted to the necessary. In this case, rsh is only used to call a script that executes a kill command to send a signal to some other process on the server. This "nudge" should happen as fast and reliable as possible. Unfortunately, I don't know any shell script command that uses UDP. –  user1812379 Nov 17 '12 at 22:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.