0

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

t6d
  • 527
  • 2
  • 5
  • 12

3 Answers3

1

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.

Geraint Jones
  • 2,503
  • 16
  • 19
0

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

krissi
  • 3,387
  • 1
  • 19
  • 22
0

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.