I am new to Linux environment and I need little guidance. I made a mistake while setting up the password and username of mosquito MQTT broker on AWS ubuntu 18.04 instance. I have altered the contents of /etc/passward file. Because of this sudo is completely broken. Whenever I try to give commands related to sudo, I am getting the above mentioned error. Later I found out there is another backup file in /etc/passward- file. So I need to copy the contents of /etc/passward- to /etc/passward in order to restore sudo. I tried using normal cp command but unfortunately I got an error saying "Permission denied". Is there anyway I can copy without using sudo?
NOTE: I am using AWS ubuntu 18.04 linux instance.
Any suggestions are welcomed.
Thank you