Please refer to point d in the question to understand the below points.
Point d. in the image below
I don’t think that the question is asking to make App Server users to be able to login password-less to the Backup Server.
It only says, “make sure script won’t ask for password while copying the archive file.” So in order to fulfil the password-less copying from one server to another, I had to setup a password-less ssh login between those two servers which I did.
I could have copied the public key of Tony user but I would have to perform all the tasks with SUDO privileges only right because all the directories were in the / location which a normal user is denied access to.
So instead of doing sudo sudo in every command, I simply switched the user and did all the steps.
So even if I did →
[logged in as Tony user]
sudo vi /scripts/scriptname.sh
[logged in as root in App Server 1]
the ownership for the script file would be root user only. So there was no sense doing all the tasks being a normal user on App Server 1.
Secondly, it says,“Additionally, the respective server user (for example, tony in case of App Server 1) must be able to run it.” ----> The question would obviously not refer to password-less login to Backup server by saying the word “run it”. The question is referring to the file which is on the backup server.
Yeah, it is a pain for the users to enter the password every time they login to the Backup Server but the question didn’t asked to make Users for password-less login to Backup Server or else it is only a single command thing to do.
So as per the above explanation, the .zip file must have an (x) permission on others so that our users from App Server 1, 2 and 3 could run the file.
Also I want to highlight something. We totally forgot the problem here while discussing.
The problem is "Kodekloud’s verification system was not able to find the .zip file copied by the script on the Backup Server."
The problem was nowhere around what the permissions were or are users able to run the file or not.
See the picture below —
THESE ARE THE IMAGES FROM MY FAILED TASKS.
I hope you understand.