I am logging to a server using username 'test'. I want to execute some commands as user test2.
When I am trying to run `sudo su - test2 -c 'ls'` it gives error user 'test' is not allowed to run sudo in host. But when I login into the account 'test2' using sudo su - test2 all these commands work.
Is there any way I can get this working? I need to do that because I want to run this command from a script. I think it is related to permissions for user test. Please advise.