Why is sudo bash needed

bashshellunix

I was reading the following code:

$ sudo bash
# cd /home/
# ./gitpull.sh

Why do I need the first line, what does it do exactly? What if I just did $ sudo instead of $ sudo bash ?

Best Answer

It starts a bash shell as a root level user. You need it because typically normal users can't access /home/

The danger of what you are doing is you are in a root shell -- you can mess up your machine rather easily.

Related Question