Home

On 9/4/10 0 comments


On ubuntu by default the root account is not active, but we can use a regular user account to gain root privileges. to use root privileges, we can also use the command sudo (super user do). At the moment we use sudo we are asked to enter a password first, which prompted the password is our username password, not the root password. Use sudo for certain periods, if we do not use a period of time we are asked to enter the password again when we use the sudo command.

Now we will try to use sudo, open gnome-terminal and try typing the following command:

numb@numb-ubuntu-10:~$ cat /etc/shadow
cat: /etc/shadow: Permission denied

turns out the files in /etc/shadow require root privileges to read it, now try the command :

numb@numb-ubuntu-10:~$ sudo cat /etc/shadow
[sudo] password for numb:
root:!:14732:0:99999:7:::
daemon:*:14728:0:99999:7:::
bin:*:14728:0:99999:7:::
sys:*:14728:0:99999:7:::
....
....

on orders over we'll have to type sudo, each will use root privileges. So that we do not always use the sudo command it's good we get to the root shell by typing the command
sudo -i

example
numb@numb-ubuntu-10:~$ sudo -i
root@numb-ubuntu-10:~# id
uid=0(root) gid=0(root) groups=0(root)
To exit the root shell, you can press Ctrl + d

0 comments:

Post a Comment