Sadly this is not complete protection. Many Linux distributions configure sudo to prompt for the password only once every 15 minutes or so. If you have successfully executed sudo in your terminal within the last 15 minutes, any malicious code that you run can silently escalate its privileges to root just by starting with "sudo -i;".
You need to have the following in /etc/sudoers in order to be truly protected by not being logged-in as root:
You need to have the following in /etc/sudoers in order to be truly protected by not being logged-in as root: