Search code examples
authenticationantrsynctrace

Tracing authentication method for rsync via Ant script


There is an Ant script which is rsync-ing data to a remote server via an exec statement, however I don't see any method for authentication to the remote server. The script runs as root (OS is Mac OS X), but when I try to SSH to the remote server as Root I get prompted for a password. How do I track down where/how the authentication is happening?

 <exec dir="/usr/bin/" executable="rsync">
     <arg value="-av" /> 
    <arg value="${bluealphaout}" />
    <arg value="Remote_Server::Some_Folder/by_name/" />
    </exec>

Solution

  • You'll need to show the command-line used to run rsync. I'm guessing it's one of two problems:

    1. Your rsync command is not running over ssh (See the "-e" option in the manual)
    2. Your ssh connection is using an alternative ssh key

    For an example of running rsync over ssh (using ANT) see:

    Finally, if all else fails (and provided rsync is using ssh), you could check the sshd log file on the remote server to see how the connection is being authenticated using ANT.