-1

I have Ubuntu 12.04 installed on my PC, recently I have edited /etc/passwd and changed

user1:x:00:00:user1,,,:/home/user1:/bin/bash

to give root permission to user1 and the system always need to login as root, for running some custom software.

Now it seems the sound is not working, the volume icon is disabled. I understand that the pulseaudio demon can't be run as root that's why the audio is not working. How can I resolve it, like set the permission of pulseaudio to run as root.

When I type the command

 /usr/bin/pulseaudio --start

Giving me the output

W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
E: [autospawn] core-util.c: Home directory /home/user1 not ours.
W: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
E: [pulseaudio] main.c: Failed to acquire autospawn lock

Edit

Solution for problem:

I have fixed the problem by disable root checking for pulseaudio equalizer

sed -i 's/exit 1/#exit1/g' /usr/bin/pulseaudio-equalizer 

marked as duplicate by sebasth, user88036, RalfFriedl, Isaac, Shadur Oct 8 '18 at 13:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Please see This Page – MelBurslan Mar 21 '16 at 7:33
  • 1
    you don't need to edit passwd to give root access. Just run sudo useradd user1 sudo – Aniket Bhattacharyea Mar 21 '16 at 7:34
  • Does that required to enter password, for each time for some root operation?. – Haris Mar 21 '16 at 7:37
  • @MelBurslan I have run the command adduser user1 pulse-access but still the sound cannot enabled. – Haris Mar 21 '16 at 8:12
  • 1
    @Haris Note that if you want to notify someone of a message, you need to put an @ followed by their username. And put information in the question, not comments. – Faheem Mitha Mar 22 '16 at 5:07
5

“Give root permission to user1” is imprecise. What you actually did was to make user1 an alias for the root user. What determines the identity of a user is the user ID, not the name. The name is just what you type when you log in (that also determines what shell you get and what group you're in, but that's about it). Now “the system always login as root for some reason” — well, yes, the reason is that you are logging in as root.

Some programs don't expect to run as root and won't work properly.

You need to repair the entry in /etc/passwd to give user1 their user ID back. Then change the ownership of all files in user1's home directory back:

find /home/user1 ! -type l -uid 0 -exec chown user1 {} +

Then log out and back in, and your system should work again. Some bad side effects of the current problem may remain; be careful about changing files' permissions and ownership if you don't know exactly what you're doing. If in doubt, ask here.

  • I think you are misunderstand the line the system always login as root for some reason, I have edited the question. Actually this was my requirement to login to the system as root, and I cannot changed that back. Actually I have customized Ubuntu and created a liveISO with a custom app running on it. And the system is working fine for last 8-10 month without any major problem, except the issue like audio. So is there any way to get audio work with root user. – Haris Mar 22 '16 at 4:15
  • @Haris Don't run pulseaudio as root. Don't add an entry to /etc/passwd with a UID of 0. If you have some software that must run as root, run that software as root, and only that software. – Gilles Mar 22 '16 at 11:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.