Tagged Questions
-3
votes
2answers
70 views
How can I setup a way to temporarily block my own access to my /etc/hosts file? [closed]
I'm interested in being able to temporarily prevent myself from editing my /etc/hosts file for the sake of productivity. When I am trying to get work done, I like to block access to the websites that ...
4
votes
2answers
98 views
Automatically execute bash script under the privileges of another user
Is there a way to execute a bash script under the privileges of another user (automatically)?
I think "sudo" is the right way, but I don't know how to automate the process.
E.g. I want to run ...
1
vote
3answers
318 views
Use sudo command for script SSH server
I have to do following steps on several servers:
log in with my username
type in sudo su -
type in amCLI -l 32/1 | grep Firmware
So I would like to write this all in one script, my idea was:
...
1
vote
1answer
492 views
How to run python script on startup with sudo permission on Mac OS
I have created a script with python that basically ping all servers found in my lists. I need this script to be run on startup with sudo permission.
So the question is, How do you run the script on ...
1
vote
2answers
482 views
Get the user's home when sudo-ing in a script ran by root
In the manpage of sudo I found the -H option, but I don't seem to understand how it works. The manpage says:
The -H ( HOME ) option sets the HOME environment variable to the
homedir of the ...
1
vote
1answer
912 views
How do I run a SVN post-commit script as root?
I have a SVN repository server that runs under the repository user, and I want to run a script after every post-commit action.
I therefore wrote a shell script that runs from the hook after every ...
1
vote
2answers
383 views
GNU/screen not setting $STY
I'm trying to script the spawning of GNU/screen windows by using commands of the form screen <CMD>.
For some reason when I start GNU/screen (by hand), the shell that it starts in window 0 ...
2
votes
4answers
1k views
sudo displays typed password in bash script
I have a bash script that uses sudo a few times. There's a couple of strange points about it though.
It asks me for my password a few seconds after I've already entered it for a previous command.
...
2
votes
5answers
3k views
Problem with running a script at startup as root?
The main question:
Is there a way I can run 'completely' one of my script when ubuntu's desktop appears no matter if root , administrator, desktop user or an unprivileged user logged in?
What does ...
21
votes
2answers
22k views
SSH: execute sudo command
I have an interactive shell script, that at one place needs to ssh to another machine (Ubuntu based) and execute something as root (the user should enter his password, but the remote command should ...