4
votes
2answers
19 views

Use non-root user configuration for root account

When I work with the terminal and use su or sudo to execute a command with the root user's permissions, is it possible to apply the configuration of my "non-root user" (from which I am invoking su or ...
4
votes
3answers
940 views

Automate login with sudo and su

I know the security risks, but I am performing this experiment/exercise on an old, seldom used *nix machine I have laying around the house. So doing this exercise will not bring any security risk to ...
4
votes
1answer
610 views

How to run this in sudo?

I have this line that I execute from php sudo -u db2inst1 -s -- "/opt/ibm/db2/current/bin/db2 connect to PLC; /opt/ibm/db2/current/bin/db2 \"update EDU.contact set MOBILE_PHONE = '123'\"" it works ...
3
votes
2answers
4k views

executing if-statement from command prompt

In bash I can do the following: if [ -f /tmp/test.txt ]; then echo "true"; fi However, if I add sudo in front, it doesn't work anymore: sudo if [ -f /tmp/test.txt ]; then echo "true"; fi -bash: ...
2
votes
1answer
160 views

How can I adjust this short shell script to fit my needs?

I am attempting to force powertop to run when I log in by using the Startup Applications wizard in Ubuntu. Under the 'Command' entry, I've placed gnome-terminal -x ...
3
votes
1answer
271 views

How to use SCSUDO to run scripts with positional parameters?

I am trying to use scsudo to run a number of defined commands to stop and start processes on a UNIX host. The issue I am experiencing is that scsudo does not seem to like the use of positional ...
1
vote
6answers
306 views

Minimize need for sudo

Very often I need to use the sudo command because the command I'm running needs higher privileges. Is there some method to minimize the usage of sudo and/or a way to use it that's faster than typing ...
2
votes
4answers
339 views

sudo to remember password for list of commands?

Is there a way in Linux to make sudo command to remember the password the user entered for in the first of the lines? For example, for a list of commands that the user has to enter, the some of then ...
15
votes
2answers
6k views

Is it possible to save as sudo from nano after you've forgotten to run as sudo?

A lot of the time I edit a file with nano, try to save and get a permission error because I forgot to run it as sudo. Is there some quick way I can become sudo without having to re-open and re-edit ...
2
votes
3answers
751 views

How do I use redirection with sudo [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on Yeah I could (and probably will) just escalate to root, but I'd like to know why this doesn't work? ...
9
votes
2answers
3k views

When do su and sudo use different passwords?

I am able to run anything using sudo; my password is accepted. But whenever I try to do su from a shell, it fails with: su: incorrect password What can the problem be?