1
vote
2answers
40 views

Shell scripting, [duplicate]

I made a simple update script. Now My question was is it possible to run it automatically by loggin in on the Ubuntu Desktop and automatically provide my password (sudo) for this so I don't have to do ...
0
votes
1answer
23 views

don't have permission or doesn't exist

I'm trying to configure an Oculus rift and I have a configuration script that needs to be executed: GLADOS@deathbox:~/Desktop/OculusSDK/Tools/OculusConfigUtil$ ./OculusConfigUtil_i386 bash: ...
1
vote
2answers
64 views

Specify password for sudo in script

I am making a script that will update my system (and do some other things, but that doesn't matter). I want the script to run sudo apt-get update and sudo apt-get dist-upgrade --yes automatically. I ...
-1
votes
1answer
104 views

execute script with sudo after login [duplicate]

i need to execute the following commands AFTER login. sudo hdparm -y /dev/disk/by-uuid/443AFBAD7FE50945 sudo hdparm -y /dev/disk/by-uuid/7ABB49654B799D40 (trying to edit rc.local does not work ...
0
votes
3answers
43 views

Append an output of a command to a txt file and place it in non writable directory?

If i try for example : directory A i don't have write permission on it sudo ls -l > /home/A/a.txt bash: /home/A/a.txt: Permission denied Then how can i do this trick , any Suggestion is ...
1
vote
0answers
177 views

cannot execute script with sudo no password

I would like to create a batch file that will connect via ssh to my ubuntu server and run a script. My batch file works by using plink, I can see that the call to my script is ran but then I'm asked ...
0
votes
0answers
23 views

How to autorun bash script in terminal as root? [duplicate]

I'm trying to make this script to autorun at startup, it needs root priviges, but I'm trying to run it without typing in my password. I have tried to add it with crontab, but nothing seems to happen. ...
0
votes
1answer
40 views

Having issue with creating a script

Trying to create a simple script but I'm not having any luck. I created a file with nano, saved it. Then: sudo chmod +x filename The script is: #!/bin/bash #script to restart networking after ...
0
votes
1answer
94 views

sudoing my own bash scripting

Okay, so I have my scripts in ~/bin/, and they are added to the path normally. However, when I prefix them with sudo, they are not in the path. I figure this is because they're not in the path for ...
0
votes
1answer
985 views

Run a Python Script on Login with Sudo

I am setting up a machine that's sole purpose is to run a specific python application that uses a curses ui. That being said, there are some aspects of the application that require it to be run as su. ...
2
votes
2answers
1k views

How can I run sudo gedit as gksu gedit

I'm looking into ways of automatically loading Gedit as gksu gedit when I enter sudo gedit by mistake? I have found that I have made a number of files unreachable by using gedit and I have only just ...
2
votes
2answers
3k views

Proper way to let user enter password for a bash script using only the GUI (with the terminal hidden)

I have made a bash script that uses kdialog exclusively for interacting with the user. It is launched from a ".desktop" file so the user never sees the terminal. It looks 100% like a GUI app (even ...
3
votes
3answers
11k views

How to execute sudo commands with Expect & send commands in bash script?

Can any body let me know how to execute sudo commands with expect. I tried the following but this is not working. Can anyone give me suggestion please? set login "sasuke" set addr "hostname" set pw ...
1
vote
1answer
231 views

Can I write a python script that will automatically load a terminal as sudo?

I use sudo a lot and I am constantly having to restart my terminal (development of programs that froze usually) and it's a pain in the butt to constantly put in the sudo command and then my password. ...
4
votes
2answers
500 views

What's the difference between root account and simulated roots?

So if I disable my root account with sudo passwd -dl root I still have access to sudo {su,bash} or sudo -{s,i} conceptually how are the elavated rights different from the root account? I know the ...
2
votes
1answer
80 views

Allow any user to use shutdown with my own shell

First of all sorry if my english is not excelent but it isnt my native language. I have a project where I'm building my own shell (named MYSHELL). One of the tasks is to create my own built-in ...
3
votes
0answers
646 views

Run a script from Django view as root without asking for password [closed]

I need to run a script (text.sh) that needs sudo, without inputting password, for example: sudo apt-get update >> /home/derp/test.txt I have modified my sudoers file like this: # This file ...
0
votes
1answer
404 views

How can I run PHP scripts without prefixing my scripts with sudo?

I'd like to be able to run PHP scripts without needing to use sudo in every command. My user is not root obviously. How can I accomplish this feat? I'm new to Linux, and I have a little knowledge ...
3
votes
2answers
402 views

If I make a script that requires root privileges, do I need to put sudo in the script too?

I'm working on an installer script for the latest ATI drivers (as they are not in repo) and was wondering if I need to include sudo in the script, because it will be needed for the install.
2
votes
2answers
1k views

How to pass arguments in a script using gnome-terminal

As part of a script I have gnome-terminal -e "process involving another user" Once executed this line, I have to write in the terminal 3 times the password of this user. I wonder how can I automate ...
6
votes
3answers
5k views

Run script as root at login (no sudoer user, shell session)

Much like /etc/profile and ~/.profile but ran by root instead of the user is doing login. /etc/rc.local runs after boot but I need running the script before login. The user is not a sudoer one. ...
39
votes
3answers
9k views

How can I determine whether a shellscript runs as root or not? [duplicate]

Possible Duplicate: How can a script check if it’s being run as root? This is something I've been curious about. I make a lot of small bash scripts (.sh files) to do tasks that I routinely ...
1
vote
1answer
6k views

Sudo and startup script

I have a new asus 1215n and I need to digit commands to enable multitouch. No problem: I've made a script. Since this netbook also need manual activation of the wifi driver the complete script is: ...
5
votes
3answers
820 views

Why is this by passing the SUDO password?

I have a bash script I am using to automate a SVN checkout. The contents of the file were: #!/bin/bash cd /var/www-cake sudo svn checkout file:///usr/local/svn/bash_repo/repo/ Then when I double ...