Tagged Questions
1
vote
1answer
226 views
automate login as sudo and su
I know the security risks, but I am performing this experiment/excercise on an old, seldom used *nix machine I have laying around the house. So doing this excerise will not bring any security risk to ...
4
votes
1answer
360 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
849 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
143 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
201 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
281 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
263 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 ...
12
votes
2answers
3k 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 ...
1
vote
3answers
436 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?
...
8
votes
2answers
2k 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?