remote root login through ssh
<p>I have 2 different servers which im accessing remotely through ssh. i am currently writing a bash script that will move some archives from server A to server B on a weekly basis via crontab. script will run from server A. naturally at some point it needs to login to server B. i set up RSA keys and they are working fine (ran ssh user@B from A and it doesn't ask for a password anymore, i get right in).</p>

<p>Problem is the user@B i have doesn't have write permissions (ssh root login is disabled on B). in order to gain root access i need to login with my regular user@B then type su - and enter root password, which i have and it works when doing so from B directly.</p>

<p>My question is: Can i program the script to do this (type su - and enter the root password) automatically after logging into B as the regular user@B through RSA? and then proceed to scp the files in the destination folder on B?</p>

<p>thanks</p>