SSH sudo password problem
Jonathan S. Romero
jromero at raydiance-inc.com
Fri Oct 14 19:49:16 UTC 2005
Also if you run with cron, it will likely execute as root, and will
again look in /root/.ssh for it's certificate when connecting.
On Fri, 2005-10-14 at 15:33 -0400, Carthik Sharma wrote:
> 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 -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
More information about the ubuntu-users
mailing list