This is another way to gain root permissions on a Debian system; this is a script that will elevate the user to root for a specific command; like using the sudo
command.
su-to-root -X -c "cat /etc/shadow" |
This is what you get if you try this without root permissions.
[flynn@flynn-grid-runner ~]$ su-to-root -p flynn -c "cat /etc/shadow" cat: /etc/shadow: Permission denied |
This command only seems to work if you execute it in a terminal window where you have previously executed the sudo command. But I thought I would put this command here anyway.
Another way to get root permissions and gain a permanent root prompt is to use this command.
[flynn@flynn-grid-runner ~]$ sudo su - flynn-grid-runner ~ # |
Then you have a proper root prompt; but you have to remember that the root account can perform any task on your machine and you need to be careful what you are running. As shown below you may also use the sudo -s
command to gain root permissions. But this did not give me the distinctive colored root prompt; only the hash symbol at the end of the prompt that defines it as a root prompt; so be careful when using this command.
[flynn@flynn-grid-runner ~]$ sudo -s bash: #!/bin/bash: No such file or directory [root@flynn-grid-runner flynn]# |