Questions tagged [sudo]

sudo stands for Super User Do. It allows users to run programs with the security privileges of another user (if configured access permissions allow it), by default the superuser and is therefore prefixed before commands when full access to the operating system is required.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Errors Changing /boot/config.txt externally

I was overclocking my pi, and I went a little overkill, so now it wont boot. Im trying to change config.txt back to its previous state externally, but I don't have the permissions to do it. I tried ...
user avatar
2 votes
2 answers
66 views

Sudo still works despite removing my user from group

I just installed the April 4th 2022 edition of Rasberry Pi OS and added a root password in addition to my user password. I also did.. deluser <userme> sudo I tested my new security adjustment ...
user avatar
  • 177
0 votes
0 answers
27 views

How to open website with Python with 'sudo' permission?

I am writing a Python script to run on Raspbian that opens a webpage using webbrowser.open() and also writes to the GPIO pins to control some external LEDs. The problem is that writing the GPIO pins ...
user avatar
0 votes
1 answer
81 views

Trying to kill all processes, but new processes keep spawning

I'm trying to rename the default pi username after getting a new raspberry pi 4. I am completely new to Linux, so my knowledge of the matter is small. From what I've discovered, one way to rename pi ...
user avatar
0 votes
1 answer
42 views

Can I access the keyboard in a virtual environment that was not created with sudo?

I have a script which uses the arrows on the keyboard to provide user input. The script required the keyboard package to be installed with pip install keyboard. The script works fine outside the ...
user avatar
  • 155
0 votes
2 answers
65 views

Any way to get sudo privleges without opening a command line in raspian? [closed]

Right now to get python scripts to run with user privleges in thonny with typing in this command from the command line: sudo thonny I can't close the command window without it closing thonny also Is ...
user avatar
1 vote
2 answers
91 views

Configure RasPi 4 for headless operation

I'm trying to run a Pi 4 headless as I don't have the microusb cord available. In /boot, I ran touch ssh then created wpa_supplicant.conf and with the modified contents: country=US ctrl_interface=DIR=/...
user avatar
  • 111
2 votes
1 answer
70 views

GUI password prompt replacement for gksu won't work via SSH

Since gksu has been deprecated, I'm using the following script which emulates it using pkexec: #!/bin/bash PKEXEC_USER="root" while [[ $# -gt 0 ]]; do key="$1" case $key in ...
user avatar
0 votes
0 answers
62 views

Operation not permitted when using sudo via homebridge

I updated homebridge yesterday and now none of my stereo commands work. I use the homebridge-commander plugin to run a set of commands that use a repo of mine called pi-bose, forked from pi-rc. It ...
user avatar
  • 285
0 votes
1 answer
84 views

ClassNotFound when sudo java

I have a computer lab which is set up with piserver and 3B+ raspberry pis. I want my students to be able to write java code that will use the GPIO pins, so they will need to sudo java their programs. ...
user avatar
0 votes
1 answer
87 views

'sudo' not recognized as an internal or external command. Trying to run sudo raspi-config

I am building my first project on a Raspberry Pi 3 using an RFID HAT for Raspberry Pi. I am using Windows 10 IOT Core. The manual for the RFID HAT begins with this: I2C/Serial interface is disabled by ...
user avatar
5 votes
4 answers
10k views

update problem with apt-get after new install of OS

When ever I try to go to recommended updates I get the following error and I don't know how to fix it. I had a boot problem before I reinstalled the operating system. Thank you ahead of time for your ...
user avatar
  • 59
0 votes
0 answers
47 views

'on_picture_save' triggered script won't execute 'sftp' nor 'sudo -u' commands

My goal is to transfer to a distant raspberry pi the stream of snapshots acquired through 'motion' software. I am using 'sftp' in the following test script: (test-script.sh) #!/bin/bash cp $1 /tmp/...
user avatar
0 votes
3 answers
4k views

sudo apt-get update problem

I was trying to update my RPI. $sudo apt-get update , and this was my result: Reading package lists... Done E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable ...
user avatar
-1 votes
1 answer
46 views

OpenCV not working when ran with sudo

I have an application that uses OpenCV, and now want it to also access GPIO pins, so it needs to run as sudo. So, I tried to run it using "sudo python3 myapp.py" When I do I get the ...
user avatar
  • 51
0 votes
1 answer
324 views

Can't run `apt --fix-broken install` as normal user

`apt --fix-broken install E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?...
user avatar
9 votes
4 answers
4k views

Will Raspberry Pi OS update `sudo` to address a recent security vulnerability?

There has been some traffic online this year regarding an apparently substantial vulnerability in sudo that allows unauthorized privilege elevation - CVE-2021-3156. I've been checking sudo --version ...
user avatar
  • 17.9k
0 votes
2 answers
100 views

How to run an application with elevated privileges [closed]

I have installed VS Code on my Pi. Now I see a problem, I cannot edit and save all the files. Like files that I used to update using nano editor inside the config folders, cannot be edited and saved ...
user avatar
  • 398
1 vote
1 answer
247 views

How to configure sudo to ask for user password?

On Debian, sudo asks for user password by default. On Raspberry Pi OS, it doesn't. How to configure sudo to ask for user password?
user avatar
0 votes
1 answer
368 views

xdg-open chooses the wrong app

In a nodeJs app I have: //---------------------------- var execSync = require ('child_process'). execSync; function puts (error, stdout, stderr) {console.log (stdout)} function execute (comm) {...
user avatar
1 vote
4 answers
857 views

Edit file that requires sudo permissions from SSH client

I need to edit /boot/config.txt file from WinScp ssh client. In order to make changes in file I need root permissions for my login. As default pi does not have such permission and I don't have console ...
user avatar
  • 161
1 vote
0 answers
32 views

Cannot list any files while root

I have a remotely hosted raspberry PI running Raspbian and Nginx and I want to modify the file /usr/share/nginx/html/index.html which is owned by root. I'm very much a beginner with Linux (I did use ...
user avatar
  • 11
0 votes
1 answer
378 views

sudo "broken" - getting PAM error messages

I have a Raspberry Pi on my local network running Pi-hole. It's been all good for months, but suddenly I'm experiencing problems. When I'm logged into the RPI with ssh and try to do anything sudo ...
user avatar
1 vote
1 answer
720 views

sudo python3 generates error but python3 does not

I don't understand why "sudo python3 temphumlogger2.py" triggers a module error, while "python3 temphumlogger2.py" executes no problem. Outputs below, and code below that. I want ...
user avatar
3 votes
1 answer
757 views

Can't upgrade or install software. Get a strange error that says it failed to fetch data from a very sketchy website

When running the commands: sudo apt-get upgrade sudo apt install xscreensaver I get the error "Failed to fetch https://113store.cr/es/ Writing more data than expected (131072 > 121282)" at the end ...
user avatar
  • 33
0 votes
0 answers
88 views

While using sudo command my python script crash

I am using LIRC 10.1-5.2 with Raspbian Buster, i need to map IR keys as keyboard input. I have successfully enable to setup IR receiver with the following guide (https://www.instructables.com/id/Setup-...
user avatar
1 vote
1 answer
97 views

Lost ability to authenticate software installation etc from GUI after deleting pi user. Can still install command line

In the interest of increasing security of my pi I followed the Secure Raspberry Pi Guide After doing so and deleting old pi user and rebooting I now cannot authenticate sudo from the GUI. For new ...
user avatar
1 vote
1 answer
790 views

Run Python RPi.GPIO as sudo

I'm trying to use the RPi.GPIO Library in a python-script with root-privileges. I essentially need to run it with sudo because other stuff in my script require root-privileges. When i try the ...
user avatar
2 votes
2 answers
458 views

accidently claimed /etc folder to my "pi" user, how can i revert it back?

So i ran into an issue and i needed to rewrite a file taht was in ETC file folder and the system wasn't allowing it. I claimed the whole ETC folder.. the file wrote fine after that. Now as i am using ...
user avatar
0 votes
0 answers
34 views

Is there a secure way to run a web interface that interacts with Serial/USB?

Terrible title but I will do my best to explain. I have a simple robot that uses an Arduino Uno plugged into the USB. To interact with this as serial it requires me to run the application under sudo. ...
user avatar
  • 171
1 vote
1 answer
2k views

PIGPIO without sudo

I am working on setting up an automated deployment of an executable using the PIGPIO C bindings to a Pi Zero. I copy the executable to the pi (into a directory on pi user's desktop) as expected, but ...
user avatar
0 votes
1 answer
531 views

Changing Guest user permissions on Raspbian

I am new to this so hopefully, I am not breaking any rules and get the help I need. So, with my question, I made a guest user for siblings and other people, and I want to change permissions so they ...
user avatar
10 votes
3 answers
7k views

Sudo permissions disaster

I just got a Pi-4. I'm not sure if I did something wrong while setting it up, but after getting it running I noticed that sudo commands required no passwords. I tried to change this, following some ...
user avatar
1 vote
1 answer
3k views

sudo: command not found

My USB stick is now full of backups, and I need to delete at least one to upgrade Nextcloud. I cant. I try rm -f ./nextcloud-bkp_2017* and I get: rm: cannot remove './nextcloud-bkp_20171211.tar': ...
user avatar
0 votes
1 answer
3k views

RPi is not finding packages libapache-mod-php5 and php5

It is not finding these packages. Does anybody know why? It is not finding the installation candidate. Here is the result of sudo apt-get install libapache2-mod-php5 php5: pi@raspberrypi3:~ $ ...
user avatar
1 vote
0 answers
52 views

Server 19.10 on Raspberry Pi 4 defaults to root?

I've successfully installed Server 19.10, then got a desktop (Lubuntu) going on a single Raspberry Pi 4 (4gb). I went with the 32-bit version, having heard the 64-bit is not very stable. (Please ...
user avatar
  • 121
1 vote
2 answers
366 views

python start on boot

i am trying to get my WS2812 NeoPixel python sketch to run at boot, i used a tutorial https://tutorials-raspberrypi.com/connect-control-raspberry-pi-ws2812-rgb-led-strips/ it install the correct files ...
user avatar
1 vote
2 answers
505 views

Installing Python 3.6: question about needing sudo command for configure command

I have a Raspberry pi 3 Model B and I want to install Python 3.6 on it. A bit of context: I acquired this Raspberry pi over 2 years ago and it came with Python 2.7 and 3.4 installed by default in /...
user avatar
  • 113
0 votes
0 answers
223 views

PWM without root access (Navio2)

We use the Navio2 sensor hat from Emlid. These boards are used for a class where students develop flight software (not using Ardupilot or PX4). We roll our own framework which provides some basic ...
user avatar
0 votes
0 answers
2k views

Running NextCloud on HTTPS/SSL with LetsEncrypt

I have successfully installed Nextcloud on a Pi3 using snap sudo snap install nextcloud. Confirmation follows promptly: nextcloud 15.0.10snap3 from Nextcloud✓ installed . Now this tutorial: ...
user avatar
  • 11
2 votes
2 answers
962 views

No sound as root and even with sudo su pi

It works if I try to play a sound/mp3 with mpg321 as a pi user: mpg321 Yeah-sound.mp3 but sudo -u pi mpg321 Yeah-sound.mp3 does nothing and sudo mpg321 Yeah-sound.mp3 leads to error Can't ...
user avatar
  • 141
-1 votes
1 answer
1k views

sudo with WS2812 and Raspberry Pi

I'm trying to use the Neopixel Adafruit library with the WS2812 strip. Everything works great however there is something that I have not been able to do. I'm working on a project that requires ...
user avatar
  • 1
1 vote
2 answers
517 views

Adduser command missing

I use rkhunter on all of my RPis, since some are used as dedicated servers, to try and ensure no rootkits or other malware are installed on them. When I did the check as usual today, I got the ...
user avatar
1 vote
1 answer
536 views

Segmentation fault when sudo su or other sudo commands

I wanted to update my SSL certs on my Pi 3B+ which is running NextcloudPi. I did not touch the Raspbian System on it for at least 2 months. I am the only one who is able to login. I connect via SSH ...
user avatar
3 votes
1 answer
1k views

Neither sudo apt-get upgrade nor sudo apt-get install vim working

I just started Raspberry pi and was ordered to get vim installed. However whenever I run sudo apt-get install vim I get the following errors: Err:1 http://raspbian.raspberrypi.org/raspbian ...
user avatar
1 vote
1 answer
193 views

How to run a graphical program from a restricted user

I have two users. admin can see everything. pi is restricted. I have a tkinter python application. pi must be able to run the program, but it cannot read any of the files directly. There is a data....
user avatar
  • 163
2 votes
2 answers
4k views

Error in apt-get update

Whenever I run "sudo apt-get update" I get pi@raspberrypi:~ $ sudo apt-get update Hit:1 http://archive.raspberrypi.org/debian stretch InRelease Hit:2 http://raspbian.raspberrypi.org/raspbian stretch ...
user avatar
  • 669
0 votes
2 answers
79 views

I can not have the Permission ''sudo" to execute command lines on putty!

I have a problem for permission using "sudo" on putty (connected to raspberry pi3). My usrname is: karim My password: 0000 Each time, I have got this error when executing a command line " karim is ...
user avatar
0 votes
2 answers
275 views

uninstall a recently installed app

I installed lnd (lighgning network daemon) using the below command. sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-armv7-v0.5.1-beta/* What's the cleanest way to remove/rollback ...
user avatar
  • 129
3 votes
1 answer
2k views

Start Service with Sudo

I am trying to run an Express API server with sudo permissions and have it automatically start on boot. The API needs access to bcm2835 library, and I get the following when trying to run node server....
user avatar
  • 155