Linked Questions

24 votes
1 answer
151k views

How to run Bash script as root with no password? [duplicate]

Possible Duplicate: How do I use sudo in my script without needing a password? I want to run a bash script as root with no password prompt. I tried visudo with no luck(your_username ALL=(ALL) ...
Vromoth's user avatar
  • 711
14 votes
2 answers
31k views

Running a script when connecting a USB device

I am trying to run a script whenever a pendrive is connected to my system. I followed this and this question and it is working, but there are still some problems. This is my udev rules file: ACTION==&...
Null pointer's user avatar
  • 2,547
6 votes
3 answers
4k views

How do I tell a shell script my password?

I've been trying to create a script that runs sudo apt-get update and sudo apt-get autoremove whenever I log in. It goes like this: #!/bin/bash (sudo apt-get update) (sudo apt-get autoremove) But ...
It's Willem's user avatar
5 votes
2 answers
2k views

Run script at user login as root, with a catch

I'm trying to run a PHP script as root on user login. The PHP script adds a Samba share to the Samba config, thus the need for root privileges. The only issue here, is that the user doesn't exist ...
nwalke's user avatar
  • 366
4 votes
2 answers
2k views

Microsoft Arc Mouse (Bluetooth) stops scrolling after suspend Ubuntu 19.04

Update: Upgrading to Ubuntu 20.04.1 has now permanently resolved this issue for me. Edit: This is more complicated than I first noted. I don't only lose the scrolling capability on suspend, it is also ...
RaidPinata's user avatar
3 votes
2 answers
10k views

Mount samba share at login using startup script (not fstab)

Background I'm trying to automatically execute a command that mounts a password protected Samba share when my user logs in. The catch is, I share my laptop with another user, and I don't want the ...
Scott's user avatar
  • 428
2 votes
1 answer
2k views

Two users - how do I automount a Samba share for one user but not the other?

TLDR: I want to configure a box that is running Ubuntu Desktop and has two users so that it automounts a password protected Samba share when one user logs in, and doesn't when the other logs in. Long ...
Scott's user avatar
  • 428
2 votes
2 answers
3k views

Can I get Network Manager to unload/load the wireless driver?

Sometimes my wireless loses connection and will not reconnect. However, I find it will reconnect when I open terminal and run sudo modprobe -r nameOfDriver sudo modprobe nameOfDriver However, going ...
Colin Matheson's user avatar
1 vote
5 answers
1k views

Download aborted when computer went to sleep

I was downloading a large file in my browser when my computer went to sleep. The download was lost. Any way to prevent that?
fixit7's user avatar
  • 3,117
1 vote
1 answer
3k views

How to run a command that requires sudo at login [duplicate]

I made a script that controls my system LEDs and it works great. I saved it to /usr/local/bin/led-pattern and ran sudo chmod a+x /usr/local/bin/led-pattern so its executable simply by entering the ...
cheesits456's user avatar
  • 1,282
1 vote
2 answers
3k views

How to give a non sudoer access to a kernel module special device file?

Is it possible to access a kernel module if a user is not sudoer? I am trying to access a KVM, which is kernel module, as non-sudoer but I am getting an error: Could not access KVM kernel module: ...
user298350's user avatar
1 vote
2 answers
856 views

How to create a script file to input password? [duplicate]

Possible Duplicate: How do I sudo a command in a script without being asked for a password? I have a small script file, to run Nautilus as root. that reads: gksu nautilus and it prompts for ...
StanP's user avatar
  • 211
1 vote
1 answer
504 views

Run part of a command with sudo [duplicate]

I want to create a keybinding Ctrl+Alt+Delete on my Ubuntu PC. It should open htop, but I want maximum priority for it. I use this command. xterm -fullscreen -fa 'Monospace' -fs 13 -e htop It works ...
FK-VH's user avatar
  • 188
1 vote
1 answer
622 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 ...
MKJ's user avatar
  • 1,569
1 vote
1 answer
3k views

Sudo execute command in Pythonscript

I want to sudo a command from a pythonscript without hardcoding my password in it. The Pythonscript is part of a webservice on Apache2. Since it is part of a webservice, asking the user each time for ...
SgtPepper88's user avatar

15 30 50 per page