Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to retrieve a SVN dump over a SSH connection

ssh user@host "sudo -u $repo_owner svnadmin dump $repo_path"

Depending on whether I already used sudo in the last 15 minutes, I have or not have to enter my password. The problem is when I have to enter my password, it'll show up unmasked in the terminal. Therefore, I tried something like

ssh -t #...

which opens a pseudo terminal. Now, I have the problem that I don't receive a prompt for the password. The script just stops and waits for user input without telling the user that he should enter his password.

Is there a way to determine if a program that was invoked by a script waits for user input? And more important can I write something to the standard output or standard error output before an other program wants to read something from standard input. I mean some sort of hook method that is called before the actual read is done.

-- t6d

share|improve this question

3 Answers 3

use $repo_owner ALL = NOPASSWD: /the/path/to/svnadmin in your sudoers file, obviously you will need to change the path and $repo_owner to be valid.

share|improve this answer

you could use key based authorization for the ssh connection and allow user to start svnadmin (or a wrapper script) without password

share|improve this answer

ssh-agent is your answer, once set up properly you won't be using passwords and won't need to re-enter your pass-phrase more than one initial time.

share|improve this answer

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.