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
18
votes
4answers
52k views

startx: command not found

I am total newbie to Raspbian world and my problem is that I can't start the GUI because when I write: > startx I get back: bash-: startx command not found; using sudo returns the same error. ...
13
votes
5answers
131k views

How to change user pi sudo permissions; how to add other accounts with different permissions?

Since I occasionally use my Pi over SSH, I have learned that it is dangerous to allow SSH to access sudo commands. Thus, I plan to turn off this permission in the near future. But, when I install ...
12
votes
2answers
5k views

Why do I have to `sudo`?

I've followed a couple of tutorials on my RPi and a lot of commands start with sudo; what does it mean and what does it do?
11
votes
2answers
5k views

How to play audio without being root (via sudo)?

In order to play audio (espeak or aplay for example) I have to be root (via sudo). How can I do those as just a regular user? Is there a group I must be a member of or do I have to change some ...
7
votes
2answers
17k views

Automatically run a program as root for GPIO?

I have a Raspberry Pi running Raspbian that I want to auto-login and then automatically run a program that uses the GPIO as root. I have auto-login working as per this website. What is the best way ...
7
votes
3answers
10k views

Can't access shared libraries when running with sudo

I'm trying to get a demo working writing PCM to the I2S; I've created a small demo program that gives an error when I run with the following command ./demo stereo_small.wav can't open /dev/mem So I ...
6
votes
4answers
15k views

Disable sudo for user Pi (or require root password)

I'm pulling my hair out over this thing. Using Raspberian here. So I'm trying to restrict the Pi user from being able to use sudo without the root password. After heavy searching, I gave up on that, ...
6
votes
2answers
6k views

Node.Js on raspbian not found with Sudo

I installed node.js according to this article . For this i downloaded a precompiled node.js arm-pi distributition and unzipped it cd /opt sudo wget http://nodejs.org/dist/v0.10.28/node-v0.10.28-...
5
votes
2answers
2k views

Why does sudo not work in this case?

I was playing with the raspberry pi leds (How do I control the system LEDs using my software?) Interestingly, on my pi the following command fails: sudo echo heartbeat >/sys/class/leds/led0/...
5
votes
2answers
11k views

Autorun Firefox on startup…grrrrrrr!

Long Story (Short): Okay, I've read all of the guides, questions etc I can find and it's still not happening. I can't get the browser to open its self up when the pi boots. Background: I'm following ...
4
votes
1answer
25k views

Why my program won't communicate through ttyAMA0 on Raspbian (Jessie)?

I am running two different Raspberry PI and they are running Raspbian Wheezy and Jessie. On Wheezy, I simply commented out a line T0:23: respawn:/sbin/getty -L ttyAMA0 115200 Vt00 in /etc/inittab file....
4
votes
1answer
4k views

How can I connect to the SFTP server with sudo via WinSCP?

I want to use WinSCP to connect to the Raspberry Pi standard SFTP server. I also need to have root access. How can I do this without logging in as root (using sudo)?
4
votes
1answer
9k views

Pi3 “unable to resolve host” message

I have a message saying:"sudo: unable to resolve host (myhostname)" each time i write a command. My hostname do not contain any capital letter or number. thank you
3
votes
4answers
7k views

How to solve “Encountered a section with no Package: header” error?

I am running a bunch of class Raspberry Pi computers behind a school proxy. I'm using Raspbian off a very recent NOOBS image. The internet connection is supplied through the school WiFi and after ...
3
votes
2answers
9k views

How can I run gparted over ssh?

I'm SSHing into my RPi, with X forwarding enabled. I'm trying to run gparted, but it seems to fail for me. $ gksudo gparted ====================== libparted : 2.3 ====================== The program '...
3
votes
2answers
230 views

Problems getting df to update on my raspberry pi

I am a relative newbie to this however I have a couple of raspberry pi's (with the standard out of the box configuration) and was writing a PHP that linked to a df shell command. However I found that ...
3
votes
1answer
4k views

Command line broken (SD card corrupted)

EDIT You'll find the original question below the line. This edit is intended to explain better what was my real issue according to the comments. I could login (by SSH using WiFi) on my Raspberry ...
3
votes
2answers
9k views

Permission denied for GUI operations

Running Raspbian on RPi B+, I can sudo in command mode and do all operations like deleting a directory, etc. But when in GUI mode I get permession denied, although I am using the same user in both ...
2
votes
2answers
970 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 ...
2
votes
2answers
14k views

Access denied when starting systemd service

Noob question, but hopefully someone can help me out here. I'm transitioning from init.d to systemd on my RPi running Linux, as I'm told it would cut my boot time in half. My init script requires ...
2
votes
3answers
772 views

Run rpi_ws281x without sudo

I compiled the rpi_ws281x Library and the neopixel python wrapper following the instructions on https://learn.adafruit.com/neopixels-on-raspberry-pi/software Link broken try https://github.com/...
2
votes
2answers
14k views

sudo error - “Structure needs cleaning”

On my Pi Zero, if I issue a sudo su I get the following: $ sudo su sudo: error in /etc/sudo.conf, line 0 while loading plugin `sudoers_policy' sudo: /usr/lib/sudo/sudoers.so: Structure needs cleaning ...
2
votes
4answers
5k views

sudo apt-get not working

I was trying to install re2c but terminal replies the following: sudo apt-get install re2c Reading package lists... Done Building dependency tree Reading state information... Done The ...
2
votes
2answers
126 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 ...
2
votes
2answers
16k views

Sudo has stopped working : sudo: error in /etc/sudo.conf, line 0 while loading plugin `sudoers_policy'

I have a weird issue with my Raspberry pi - sudo has stopped working. Every time I try to run a command using sudo, i get this: sudo: error in /etc/sudo.conf, line 0 while loading plugin `...
2
votes
1answer
376 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 ...
2
votes
3answers
3k views

CGI and sudoers

I may got stuck in a very simple problem, but I can't figure it out. I would like to run using a cgi script a simple command: sudo service transmission-daemon stop in order to stop a system daemon. I ...
2
votes
2answers
924 views

sudoers file changed?

I usually SSH into my Raspberry Pi with the "pi" account. I always have to type my password (every 5 mins) when I want to use sudo. Now I don't have to do that anymore. My sudoers file has the ...
2
votes
1answer
636 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....
2
votes
0answers
825 views

run startx not as root

Scenario: So I want to run startx. The problem is, it won't let me write to tty0 Fatal server error: (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied) so I tried to run sudo startx, ...
2
votes
0answers
392 views

How to connect to Bluetooth LE devices without being root (via sudo)?

I am running Raspbian with BlueZ 5.30 and a Cambridge Silicon Bluetooth USB Dongle installed. I can successfully bring up the BLE interface, as well as detect and connect to a TI SensorTag over BLE ...
1
vote
1answer
6k views

/etc/sudoers file is completely corrupted parse error in /etc/sudoers

When I edited my sudoers file & saved it on my Raspberry Pi, it's giving me: sudo: parse error in /etc/sudoers near line 26 sudo: no valid sudoers sources found, quitting sudo: unable to ...
1
vote
1answer
80 views

How do I make sudo!! add a space after sudo?

When I type sudo!! it never puts a space between sudo and anything. How do I make sudo!! add a space? Example: nano text.txt sudo!! sudonano text.txt Maybe I am using it wrong but it never works ...
1
vote
2answers
4k views

Accessing EXPORTED Environment Variables in Python

An often asked question, I know, but after searching through other solutions I'm still having problems. Most solutions say to make sure your variables are exported before trying to access them, but ...
1
vote
2answers
863 views

sudo without password: More of an issue on Apple?

I asked this question over on the Raspberry Pi forums in an attempt to keep it low key, but I can't seem to find it now, so I'll ask it here. It is on-topic and definitely specific to the Raspberry Pi....
1
vote
1answer
7k views

autorunning a python script at startup not working

I have a script called BOAT.py and it lives in /home/pi/. I want to autostart it at boot and I did a lot of research about doing so. I found many ways but none of them work. I tried writing sudo ...
1
vote
2answers
43 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 /...
1
vote
2answers
136 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 ...
1
vote
2answers
121 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 ...
1
vote
1answer
6k views

Accessing gpio not working as non-root. “Can't open /dev/mem: : Permission denied”

I am attempting to get a c++ program to access the gpio as non-root. I am on a raspi 2 running Jessie. I followed the instructions on issue: Access GPIO pins without root. No access to /dev/mem. Try ...
1
vote
1answer
652 views

Remember sudo password in Xbian

How can I make Xbian to remember the sudo password for a while? Performing administration tasks on it gets painful with the OS requesting sudo password at every command. The funny thing is that if ...
1
vote
1answer
159 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 ...
1
vote
1answer
637 views

Run shell script from PATH using root

I have added a shell script to my ~/bin folder. When I type the script name normally in the terminal it finds the script just fine. However, when trying to launch the script using the sudo prefix, I ...
1
vote
1answer
1k views

Raspberry Pi 3 with Ubuntu 16.04.3 LTS sudo apt-get update exits with dpkg error code (1)

I'm running a Raspberry Pi 3 with Ubuntu 16.04.3 LTS xenial. sudo apt-get update exits with: dpkg: error processing archive /var/cache/apt/archives/linux-firmware_1.157.11_all.deb (--unpack): trying ...
1
vote
1answer
69 views

Contradictory advice in visudo comments; is one way right?

This question arises on a Pi running RasPBX, which is Rasbian + Asterisk, but I think it will be the same under straight Raspbian. I run certain admin functions remotely against the PI from a Windows ...
1
vote
1answer
173 views

Removing sudo from Pi default user

I have strange bahaviour from my Pi. My /etc/sudoers looks like: # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead ...
1
vote
1answer
1k views

How to permanently delete this line in Kernel IP Routing table

I have a problem to delete line in next routing table. Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 160.99.37.11 0.0.0.0 ...
1
vote
2answers
1k views

Python doesn't recognize cv2 when running under sudo

I've installed opencv with python 2.7 using this tutorial. I've created a test python file and everything works fine. But when I try to run it as sudo, it throws an error: ImportError: No module ...
1
vote
1answer
248 views

NodeJS + Say does not work if run with sudo or on startup

I am trying to get a Raspberry Pi to work without a screen. However I want Text To Speech functions. I have installed festival and gotten the USB sound device to be default. Everything works except ...
1
vote
1answer
2k views

Sudo not working - No valid sudoer sources found

After mistakenly changing the permissions of the /etc/ folder to 777 in-order to modify files, I have been getting this error when using the sudo command and this results in commands not working ...