Linked Questions

25 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
  • 721
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
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
4k 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,284
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
1 vote
1 answer
627 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
0 votes
1 answer
329 views

How to bypass sudo password for everything inside a script?

I have a PADD setup on my Raspberry Pi 3 running on Ubuntu Server 20.04. I can successfully bypassed sudo password authentication by adding: pihole_display ALL=(ALL) NOPASSWD:ALL But when I try to ...
YamiYukiSenpai's user avatar
0 votes
1 answer
2k views

After using tablet mode touchpad and keyboard not responding on Aspire R13 - Ubuntu 15.10

I am working on an Acer Aspire R13 and everything is working fine until I close my lid to tablet (so the lid is closed but the screen is on top). After I do, touchpad and keyboard are not responding ...
narranoid's user avatar
0 votes
1 answer
307 views

What are the files needs to be edit to add a user? and what to be write?

I am trying to write a C program to add a new user to my Ubuntu 14.04. I edited 1) /etc/passwd sachin:x:65535:1:sachin:/home/sachin:/bin/bash 2) /etc/shadow sachin:$6$VwBWgroA$t4KXLWIf81sWtiA1/a....
mr.Cracker's user avatar
0 votes
1 answer
280 views

run ap-hotspot commands from a saved file

How can I create a text file to automatically run these commands: sudo ap-hotspot start sudo ap-hotspot configure sudo ap-hotspot stop sudo ap-hotspot restart One file for each command. I tried ...
Ciprian's user avatar
0 votes
1 answer
169 views

Swap drive not turning on when I log in

Recently I added a new 40GB hard drive as swap. I want the swap to be enabled when the computer logs me in. I followed the directions here to make the swap command run on start up. I added swaps....
Blue Ice's user avatar
  • 381
1 vote
0 answers
264 views

Problem with gnome-terminal, but not with xterm?

I have a script called start-hotspot-terminal.sh. The text in it is: #! /bin/bash x-terminal-emulator -e "sudo /home/user/tools/start-hotspot.sh; read -p 'Press [Enter] to close terminal.';" There ...
John Red's user avatar
  • 869
1 vote
0 answers
89 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 ...
m-ric's user avatar
  • 345
0 votes
0 answers
40 views

Custom script not working as expected in ubuntu [duplicate]

I wrote a java application, want to register it as a service, so wrote a bash script in /etc/init.d/. Here is the script: #!/bin/sh # # chkconfig: 345 50 83 # ### BEGIN INIT INFO # Short ...
Ajay Kulkarni's user avatar
0 votes
0 answers
43 views

Applying password with command in Terminal [duplicate]

Is there an option to apply a password with the command in the terminal? Somethhing like: sudo some-command -pass=mypass I'm just curious, I know that this is not safe.
Aleksandar's user avatar

15 30 50 per page