Can sudo affect the entire server or just the users account

sudo

I recently spent quite a lot on a vps for my business and have begun setting up ssh and a cpanel account for each of my sites.

I started to install composer on an account but need root privileges.
My question is if you are using sudo as a privileged user can you bring down the whole server if you make a bad mistake or do changes only effect that specific user account and not root?

Building on this is the account completely isolated from root or can you put the whole server at risk potentially (if you tried really hard)? Is sudo exactly the same as root access but only within the account, are you just switching to root? Is there any way to limit the damage I could cause to just the user account, is sudo the best way to install packages on my accounts?

Best Answer

When you invoke sudo (without an explicit user argument), you are effectively root for the duration of that command. If the command launches a new shell, all commands run from that shell are also root. So yes, anything you do with sudo can affect the entire server.

For more detail on exactly how it works, see the following Unix StackExchange question:

How does sudo really work?

Related Topic