@Ali you don’t need to use sudo that means you are behaving like root. If you wants to see what is difference b/w sudo or normal user do one thing.
try it :–
before try this login from sudo user like thor.
thats why your task is failed.
In the task, ssh passwordless authentication from thor user, sudo user of jump host.
to app server sudo user is tony, steve, & banner. so you have to try like :–
ssh-key-gen -t rsa
after that copy, you can be able to login without password. If still facing permission denied issue, You have to move into ssh configuration file and change configuration of password authentication of target host system.
Hope you will get my points.