Linked Questions

99 votes
6 answers
348k views

How to avoid being prompted for a password by sudo? [duplicate]

I know I can become root (super user) via the su command but I have to authorize it after entering the commands. Is there a way I can become root and authorize (with password) in one line
Vader's user avatar
  • 1,382
5 votes
3 answers
11k views

Allow "root" program to run without privileges [duplicate]

I've changed my ctrl-alt-l shortcut so instead of just locking the screen, the system goes into suspend. (for reference, the command is gksudo pm-suspend-hybrid) as you can see, the program needs to ...
jackweirdy's user avatar
  • 3,440
8 votes
1 answer
8k views

How to check UFW status without sudo (or being root)? [duplicate]

I'm running some scripts to check the UFW status and would like to run sudo ufw status without having to do sudo. I was hoping to find a firewall or ufw group to add myself to, but I didn't find any. ...
not2qubit's user avatar
  • 606
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
0 answers
6k views

Poweroff Ubuntu without sudo, without password, over SSH [duplicate]

I have Ubuntu 18.04.1 LTS and trying to execute "poweroff" as a sudoer but without needing to enter the password. I added this line to visudo: nurp ALL = NOPASSWD: /sbin/poweroff It gives this ...
nurp's user avatar
  • 131
2 votes
2 answers
2k views

Editing Sudoers to avoid typing a password for iwconfig command [duplicate]

I wanted to follow this guide to avoid typing a password every time I want to use "sudo iwconfig" command http://ubuntuforums.org/showthread.php?t=1132821 I tried the steps with "apt-get" command ...
loo3y35's user avatar
  • 511
0 votes
1 answer
2k views

user Without root Permission [duplicate]

As a system administrator I want to give permission for user let's say "teacher" to run commands as root without knowing password of root, what to do?
ubuntuUserFromKZ's user avatar
0 votes
1 answer
1k views

shell script without password [duplicate]

I am executing following steps to mount my server and copy the files. But it interrupts for password. How can I do it automatic ? sudo apt install cifs-utils sudo mount -t cifs -o user=user.name //...
techy's user avatar
  • 127
0 votes
1 answer
509 views

How do I add a command permission to specific user to do it without password? [duplicate]

I want to give permission to a user to do shutdown command without password. Shutdown command need root privileges. If I give NOPASSWD in /etc/sudoers, the user can do all command that need root ...
Mas Bagol's user avatar
  • 1,351
0 votes
0 answers
330 views

startup script that needs a user password to execute itself (ubuntu 16.04) [duplicate]

Let's say I wanted an automated script to start right after a login prompt. The script, however, needs a user password before it can be executed manually using sudo 'script' command from the terminal. ...
user633551's user avatar
0 votes
0 answers
104 views

How to make a command execuitable without root previlages? [duplicate]

I want to make some commands,such as ntpdate,shutdown etc, to execute without asking me for a password or without using "sudo" for "all users"(even normal users who have no sudo privileges) . I want ...
Meow's user avatar
  • 1,357
1 vote
0 answers
83 views

How can i enable user to have reboot privileges without sudo? [duplicate]

How can i enable user to have reboot privileges without sudo? Need to keep sudo password enabled. ssh user@server "sudo reboot" does not work because it requires a password to be entered. Want ...
rjt's user avatar
  • 426
0 votes
0 answers
65 views

kill process without inputting password [duplicate]

EDIT I ran the following: $ echo $USER goldy $ hostname goldy-ThinkPad-X1-Carbon-6th $ sudo visudo -f /etc/sudoers.d/kill and added goldy goldy-ThinkPad-X1-Carbon-6th = (root) NOPASSWD: /bin/kill And ...
goldylucks's user avatar
0 votes
0 answers
38 views

Unable to remove sudo access from ubuntu user [duplicate]

When i have install ubuntu at that time create admin user, Now my plan is to remove sudo access from this user and added custom sudofile for this user. First I remove sudo group from this user: $ ...
Nullpointer's user avatar
  • 1,161
257 votes
14 answers
487k views

How do I copy files that need root access with scp?

I have an Ubuntu server to which I am connecting using SSH. I need to upload files from my machine into /var/www/ on the server, the files in /var/www/ are owned by root. Using PuTTY, after I log in,...
Dimitris Sapikas's user avatar
55 votes
4 answers
284k views

How to set up passwordless SSH access for root user [duplicate]

I need to configure a machine so software installation can be automated remotely via SSH. Following the wiki, I was able to setup SSH keys so my user can access the machine without a password, but I ...
Cerin's user avatar
  • 6,485
19 votes
1 answer
16k views

How to make 'sudo' grab the password from a file?

I want to run a command that requires the sudo password say: sudo apt-get update Isn't this supposed to work (I have stored the password in a normal text file passwd.txt): sudo apt-get update <~/...
MichaelB's user avatar
  • 335
9 votes
3 answers
10k views

Ubuntu 18.04 on WSL cron daemon not running after reboot

I have Ubuntu 18.04.1 LTS running under Windows 10 Pro. After every reboot, the cron daemon is not started. I can start it manually with sudo service cron start. What can I configure or what system ...
Tulio's user avatar
  • 93
12 votes
5 answers
9k views

How to inhibit suspend temporarily?

I have searched around a bit for this and can't seem to find anything helpful. I have my PC running Ubuntu 12.10 set up to suspend after 30 minutes of inactivity. I don't want to change that, it works ...
Zorn's user avatar
  • 123
10 votes
2 answers
8k views

I need rules to drop some malicious Apache connections

I drop all traffic on ports except on 80 for my web server. I have some rules like this on iptables: iptables -A INPUT -p tcp -m tcp --dport 80 -m string --string "cgi" --algo bm --to 1000 -j DROP ...
Javier Palmero's user avatar
15 votes
2 answers
5k views

How do I call gnome-session-quit with countdown from Unity?

To be able to shutdown with a keyboard shortcut we can assign gnome-session-quit ---power-off to a custom shortcut. In Unity this will lead to the following dialog: Then we need another at least two ...
Takkat's user avatar
  • 142k
11 votes
3 answers
10k views

Where are the startup scripts for Unity Desktop?

I want to run a script as soon as my lightdm authentication succeed, and my Unity starts loading. and i want to run my scripts as a root user. where are startup scripts located in Unity ?
Shnd's user avatar
  • 223
8 votes
2 answers
8k views

How do I make a sudo command start at start-up with a 1 minute delay?

I would like to make a sudo command (sudo service smbd restart) run after 1 minute of being logged on. How would I go about doing this? P.S. This is a system with no monitor, mouse, keyboard or ...
user2235532's user avatar
12 votes
1 answer
10k views

How do I add sudo commands to a keyboard shortcut?

I am running Ubuntu 16.04 on a Sony Vaio laptop, which features a keyboard backlight. I can enter this command into the terminal, putting a "0" in place of *value* to turn the backlight off, and a "2" ...
Jason's user avatar
  • 123
5 votes
2 answers
20k views

Allow to mount/unmount a specific device to a specific user

I know I can give permission to use "mount/unmount" through sudo some users without password. But how can I give permission to use "mount/unmount" only for /dev/sda2 and not for /dev/sda10? For ...
Dimetry's user avatar
  • 247
4 votes
2 answers
2k views

Trying to pass two variables in a bash script

I am trying to make the following script work for the ufw command which is expecting me to press y or n to confirm my command. In addition I want to pass my password to the sudo command (I know, bad ...
Robert Baker's user avatar
7 votes
2 answers
22k views

Run "sudo arduino" with .desktop file

To the close voters: seemingly a dupe, but not quite, at least not of the suggested one: in the linked question, the commands can be added safely to the sudoers file. In case of an IDE, it is a bad ...
Metalzero2's user avatar
3 votes
3 answers
51k views

/etc/profile permission denied

I'm running an Ubuntu 12.04 LTS partition and I've recently have had issues logging in. From the GUI login screen, when I enter my username and password, it takes me right back to the login screen. ...
Anu Vedantham's user avatar
4 votes
1 answer
9k views

How to execute "sudo chmod 777 /dev/ttyACM0" from shell script?

I want to give access to serial port /dev/ttyACM0. How to execute the "sudo chmod 777 /dev/ttyACM0" command from shell script ?
Indrajeet's user avatar
7 votes
2 answers
5k views

How to monitor battery condition and pop-up notification?

Essentially, I would like this comment into a working answer. I know how to extract the battery percentage from How to check battery status using terminal?: upower -i $(upower -e | grep BAT) | ...
landroni's user avatar
  • 5,941

15 30 50 per page