2
votes
1answer
55 views

Permission denied error after SSH login

I am having Permission denied errors after logging with non root user (which has permissions to do "sudo -i" command). I get these errors: -bash: /bin/uname: Permission denied -bash: [: =: unary ...
1
vote
2answers
53 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
vote
1answer
40 views

Turn off/sleep after script completion

I have a little script. It's ripped out of a Youtube tutorial, untested, ugly, and not very good. It's not done and not intended for public use. Here it is: #!/bin/bash sudo apt-get -y install git ...
0
votes
3answers
56 views

Permission denied error while creating file by using script file

I have created a script file called black_list.sh. #!/bin/bash default_card=`head -1 /proc/asound/modules` echo $default_card if [ ! -e /etc/modprobe.d/sound.blacklist.conf ] && [[ ...
0
votes
1answer
51 views

What does the 'sudo -s' command do, and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
1
vote
1answer
79 views

Why is 'sudo bash' a bad idea? [duplicate]

Anyone want to comment on sudo bash in comparison to sudo su and sudo -i? I know sudo -i is the preferred because "environment". I've gotten into the bad habit from years ago when I was a kid in a ...
3
votes
1answer
157 views

Why don't the commands 'sudo bash' or 'sudo -s' ask for a password? [duplicate]

Even when I am logged in as a non-admin user, when I enter sudo bash or sudo -s, the system does not ask for any password. In the command history, I have not entered any password for sudo earlier ...
1
vote
1answer
571 views

nvcc not found, but only when using sudo

I can't get ANYTHING working on linux. I'm trying to compile CudaMiner. sudo make: ypt-jane.o `test -f 'scrypt-jane.cpp' || echo './'`scrypt-jane.cpp mv -f .deps/cudaminer-scrypt-jane.Tpo ...
1
vote
1answer
273 views

setting PATH to /etc/profile or /etc/environment does not work with sudo

I want to launch Intellij IDEA IDE via sudo idea.sh. sudo because IDE needs to manupulate files from /etc/share. idea.sh is placed at /home/<username>/<path>/bin/idea.sh. I tried to add ...
0
votes
3answers
44 views

sudo cannot do cd [duplicate]

I found the strangest thing sudo cd $pwd sudo: cd: command not found I am able to cd as a normal user.It seems that PATH is not set properly for su. How do I fix that?
1
vote
1answer
233 views

Opening Sublime Text 2 from Terminal Problems

When I run the command sudo sublime from my terminal, it opens the program but will not allow me to run any other commands in my terminal until I close sublime text. This doesn't work because I'm ...
1
vote
1answer
160 views

Why does the “who” command not show “root” as a logged in user?

When I log in as root from gnome-terminal using the command: sudo su it logs me in as the root user. Isn't this switching a user considered as a log in? Also, which command can show me all the ...
0
votes
0answers
631 views

crontab -e unable to save

I am trying to save a cronjob to the crontab file. If i just run: crontab -e, it opens up the file in sublime but when i try to save, it pops up with: Unable to save /tmp/crontab.FKjsLq/crontab If ...
1
vote
1answer
1k views

Sudo su setting default password automatique [duplicate]

I'm a newbie linux (Ubuntu) user and i have a question to sudo su, I always like use the root in the shell for no annoying privilgies errors :) But the problem is sudo su always ask me for a password ...
1
vote
1answer
24 views

Issue with Rosewell network adapter

When running the install.sh script for my roswell network adapter RnX-N180UBE I get an error Cannot change ownership to uid 1007, gid 501: Operation not permitted If anyone has any experience with ...
0
votes
1answer
60 views

Program interface is ugly when started by script

I am starting Qt-Linguist in a bash script via sudo linguist-qt4 $PathToParentDir/translate_$lang.ts I could also use gksu instead of sudo but this would add more dependencies since most people ...
0
votes
1answer
92 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 ...
2
votes
2answers
997 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 ...
0
votes
1answer
387 views

problem with PATH when using $su

OK, I'm having a bit of an issue with PATH and running a process as another user under Ubuntu. First, we check where the bin is: root@host:~# whereis start-stop-daemon start-stop-daemon: ...
1
vote
3answers
2k views

How to reset default permissions for /etc?

By mistake I have made permission changes for /etc. Now it's giving me the following error message: bash: /etc/bash.bashrc: Permission denied I have no name!@chandan-Inspiron-5520:~$ sudo ...
3
votes
3answers
10k 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 ...
0
votes
1answer
159 views

how do you make the scripts in /home/$user/bin accessible using sudo? [duplicate]

How do you make the scripts in /home/$user/bin accessible using sudo? as in: sudo $NameOfScript in using Ubuntu 12.04
7
votes
1answer
15k views

Run a shell script as another user that has no password

I would like to run a script from the main ubuntu shell as a different user that has no password. I have full sudo priviledges, so I tried this: sudo su -c "Your command right here" -s /bin/sh ...
2
votes
4answers
517 views

“sudo bash” ignoring read-only permission of .bash_history file

This problem is in an up-to-date 12.04, and seems to have started recently. I have my .bash_history file set to read only. Lately I've noticed that despite this the file is being modified ! Here's ...
1
vote
1answer
195 views

command which takes in password as argument? [duplicate]

Is there any bash command or technique through which we can enter in password alongwith the command which requires the password of superuser? for e.g sudo apt-get install kde <password> I am ...
1
vote
0answers
54 views

Execute custom bash script with sudo without passwd prompt [duplicate]

I run ubuntu-12.04 desktop x86_64. I have a simple script that needs to be accessible from the Desktop and run as root: $ cat ~/Desktop/flash.sh #!/bin/bash - cd ~/tools sudo ~/tools/fastboot-HW.sh ...
3
votes
1answer
111 views

Bash - Get Sudoer Username?

Say I have the following bash script: #!/bin/bash echo $( whoami ) This is what it outputs with and without sudo: alix@netbook:~$ ./test.sh alix alix@netbook:~$ sudo ./test.sh root The script ...
2
votes
2answers
281 views

Does sudo really make you root for a while?

On Ubuntu, in what kind of situations, if any, running a command as a non-root to access a file/folder or create/delete a file/folder using sudo may result in "permission denied" while running the ...
1
vote
3answers
3k views

Best practices for using 'sudo su'

I have been using the terminal for a while now and sometimes (actually, a lot of times) I use a command, like: cp /etc/test ~/testFolder/ and I get this error: cp: cannot open `/etc/test` for ...
1
vote
1answer
724 views

Sudo Non-Password access to /sys/power/state

On my computer, pm-hibernate appears to be broken, however using the command echo disk > /sys/power/state appears to work perfectly. Now I just need regular user access to it, using sudo. How do I ...
1
vote
1answer
199 views

Wrong autocompletion with sudo apt-get

Does anybody know why if I type: apt-get upg<TAB> I get: apt-get upgrade but if I type: sudo apt-get upg<TAB> I get: sudo apt-get upgrade-from-grub-legacy
2
votes
1answer
78 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 ...
6
votes
1answer
11k views

difference between gksudo and sudo? [duplicate]

Possible Duplicate: What is the difference between “gksudo nautilus” and “sudo nautilus”? I have tiny script that I want it to run on start-up, but it needs sudo ...
3
votes
0answers
619 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 ...
3
votes
2answers
3k views

Run Bash Script as Root

Is there some way I can run a Bash script as root without being prompted for a password every time? I'm attempting to automate the process of starting my LAMPP install, which requires me running a ...
1
vote
2answers
4k views

Passwordless su in a Bash script?

I've run into a dilemma while migrating a Hadoop installation from Oracle Enterprise Linux to Ubuntu. The prior developer put the following command into rc.local within OEL: su reporter -c "cd ...
0
votes
4answers
1k views

Keyboard shortcut to a sudo-script

How do I create a keyboard shortcut to a script that needs sudo privileges? I tried to create shortcuts via Ubuntu Keyboard Settings GUI to scripts "sh script.sh", "sudo sh script.sh" , but ...
3
votes
2answers
674 views

Enter password only once for script making many sudo calls

I am writing a script to download build and install a bunch of packages. Building sometimes takes a while, and installing requires root priviledges: make; sudo make install What happens alot is that ...
3
votes
2answers
1k views

how can a bash file run without needing to enter sudo pass-phrase manually?

I write a bash file thus: #!/bin/bash echo 1000 |sudo tee /sys/class/backlight/intel_backlight/brightness (that changes the screen's brightness) I need it to run at startup, but because ...
1
vote
2answers
543 views

asked for sudo password, post login to bash shell

With 11.10 when any of my users with the bash shell login upon success they are asked to provide their sudo password e.g. Last login: Fri Jan 20 19:13:36 2012 from x.x.x.x [sudo] password for *user*: ...
7
votes
1answer
5k views

Cannot echo “hello” > x.txt even with sudo? [duplicate]

Possible Duplicate: sudo & redirect output I'm trying to create a file in /var/www, but even with sudo this fails: user@debVirtual:/var/www$ sudo echo "hello" > f.txt -bash: f.txt: ...
7
votes
2answers
7k views

Root's .bashrc not executing on sudo -i

On one of my Ubuntu 11.10 servers, when I use sudo -i to become the root user, root's .bashrc is not being executed. On all other servers, whose relevant configurations are identical as far as I know, ...
2
votes
2answers
2k views

sudo -i only allows one argument

Is this normal? > sudo -u misc -i "ls" note test tmp > sudo -u misc -i "ls ~" -bash: ls ~: command not found > sudo -u misc -i "ls ~" -bash: ls ~: command not found > sudo -u misc -i ...
2
votes
2answers
800 views

enable auto-completion of apt-get for non-privileged user?

I've enabled apt-get in SUDO without password , and bash autocompletion for it need to be enabled as well , but how ? If i try to source that file: %> . /etc/bash_completion.d/apt No command ...
1
vote
1answer
828 views

Executing a Super-user command through .bashrc

Is it possible to execute a super-user command in .bashrc? And if so, how? It would save me having to execute "sudo /opt/lampp/lampp start" on each startup. I've considered using the LAMP stack from ...
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 ...
5
votes
4answers
24k views

sudo: source: command not found

I've been updating some of the default profile for bash, and saw from the tutorials I was following that I could reload the new profile with the new environment settings by using: source ...
1
vote
1answer
9k views

How do I enable a user to sudo without password?

I have a php script with this: <?php #echo exec('whoami'); $output = shell_exec('bash /usr/local/svn/bash_repo/make-live'); echo "$output"; ?> The make-live script contains this: ...
5
votes
3answers
818 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 ...