SSH sudo password problem

Carthik Sharma carthik at gmail.com
Fri Oct 14 19:33:40 UTC 2005


Hi Folks,

I have hit the wall (yet again) with my limited skills :o)

I wrote a bash script to remotely backup files with ssh. I have set up the
ssh server, and the laptop to communicate without passwords.

So....
1) If from the terminal, I try a
$ssh -l carthik 1.sh.nu <http://1.sh.nu> -p 8888

I am logged in without being prompted for a password.

2) If I have the same in a shell script called rsync_ssh_push.sh and execute
it thus:
$ ./rsync_ssh_push.sh

I am logged in without being prompted for a password

However
3) If I execute the same script using
$ sudo ./rsync_ssh_push.sh

I am repeatedly asked for my (carthik's) password, for each instance of an
ssh statement in the script! In the script I try to log in to the remote
server as user carthik, not as user "root" or anything of that sort.

Any hints as to why $sudo ./rsync_ssh_push.sh behaves differently from $
./rsync_ssh_push.sh ?

Thanks,
Carthik.

P.S. I can share the script once I am done fixing this problem :)

--
Ph.D. Candidate
University of Central Florida
Homepage: http://carthik.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20051014/93cabf6b/attachment.html>


More information about the ubuntu-users mailing list