After setup ubuntu with default settings, It allows user to login with password, so I use passwd -l [username] to forbid password login both in ssh and console.
But when I use sudo to execute commands, it needs password so I can't use sudo any more.
Is there any solution that I can use sudo again, another question is how to forbid password login both in ssh and console but keep sudo password auth available?