SSH sudo password problem

Carthik Sharma carthik at gmail.com
Fri Oct 14 20:34:10 UTC 2005


On 10/14/05, Jonathan S. Romero <jromero at raydiance-inc.com> wrote:
>
> 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.


Thank you,
Copying /home/me/.ssh/id_rsa.pub to /root/.ssh/ does not solve the problem,
though.

Can someone suggest a fix or a work around?

Also, if I put this in a cronjob, the "sudo " in the script will prompt me
for my password at least once (Assuming I have the above problem fixed). How
do I make it automated. In other words, how do I put a script that requires
superuser previleges in cron ?

Thanks again,

Carthik.

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 <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 :)
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20051014/28855b14/attachment.html>


More information about the ubuntu-users mailing list