0

as no user have any permission to read file.txt,then why/how 'sudo cat file.txt' prints file contents?

bs01316@bs01316:~/test$ ls -l
total 4
---------- 1 bs01316 bs01316 6 মে        7 16:20 file.txt
bs01316@bs01316:~/test$ sudo cat file.txt 
hello

is superuser & root user samething or different concept?

1
  • Close vote: Super user enabled with sudo is God and has all the powers and does not need permissions to do anything on the system, including reading, modifying, deleting files. Other than that, this question would be better suited for SuperUser. See: en.wikipedia.org/wiki/Superuser
    – Léa Gris
    Commented May 7 at 11:55

2 Answers 2

3

root essentially ignores permissions on local files. r--r--r--, for example, doesn't give root permission to read a file so much as it excludes non-root users from reading it.

There is a slight distinction between root and superuser. root is a superuser, and usually the only superuser account, though other accounts can also be given superuser status. (Someone should check me on that, though.)

sudo is just a program that lets you run a program as any other user. The default (when the -u option isn't used) is to run a program as root.

2
  • In the past, some Unix admins had a second account with the UID 0 available. Those accounts also had superuser status. Nobody in his right mind does this anymore though. Commented May 7 at 12:41
  • I was blanking on whether it was UID 0 that had the special superuser powers, or if 0 was just conventional account number that had a superuser bit set on it. (I agree, there doesn't seem to be any need for two--or more!--accounts with the same omnipotence.)
    – chepner
    Commented May 7 at 12:52
-1

if sudo(superuser) in /etv/sudouser have ALL=(ALL:ALL) ALL then it's have all privilege to do anything like the root. in this case sudo is above all like root no need to permission to do something.

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented May 7 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .