LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Permission question (https://www.linuxquestions.org/questions/linux-general-1/permission-question-367949/)

satimis 09-28-2005 06:14 PM

Permission question
 
Hi folks,

BLFS 6.1

"alsamixer" can only be evoked as root.

bash-3.00$ which alsamixer
Code:

/usr/bin/alsamixer
After running
# chmod u+s /usr/bin/alsamixer

it can be started by all users but a grey window only without colour.

How to only authenticate "satimis" to start it in colour window not all users and how to make it?

TIA

BR
satimis

bigrigdriver 09-28-2005 09:42 PM

You could try creating a special group, with only one member: Satimis. Then change the group owner to that special group 'chown root:<newgroup> /usr/bin/alsamixer'. Remove the user permission you just created, and give the new group permission 'chmod g+x /usr/bin/alsamixer'. Or something along those lines, at any rate.

satimis 09-29-2005 12:07 AM

Hi bigrigdriver,

Tks for your advice.

Quote:

You could try creating a special group, with only one member: Satimis. Then change the group owner to that special group 'chown root:<newgroup> /usr/bin/alsamixer'
A group "audio" already exists;
Code:

root:x:0:
bin:x:1:
sys:x:2:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
#audio:!:11:satimis
audio:11:satimis
video:x:12:
utmp:x:13:
usb:x:14:
satimis:x:100:
cdrom:x:101:

and "satimis" is in "100".

# ls -l /usr/bin/alsamixer
Code:

-rwxrwxr-x  1 root root 61555 Sep 20 06:59 /usr/bin/alsamixer
I tried changing;

# chown root:audio /usr/bin/alsamixer
Code:

chown: `root:audio': invalid group
but failed.

Others noted with tks

BR
satimis

Dark_Helmet 09-29-2005 12:28 AM

You modified the /etc/group file, and audio is no longer a valid group:
Code:

#audio:!:11:satimis
audio:11:satimis
video:x:12:

The manual page for /etc/group (man group) does not say you can comment a line with a beginning '#'. Delete the #audio line. Then look at the plain audio line and the video group below it. Notice a difference? You removed one of the fields. The 'x' does matter. You need to change the line to:
Code:

audio:x:11:satimis
Again, read the man page for what each field represents.

After you fix /etc/group, run the chown command again.

Then, as a user satimis, execute groups and make sure audio is listed. If it isn't, you need to log out of the system completely. Opening a new xterm won't work. In fact, I would suggest you reboot if the audio group is not listed. Then run the command again to verify satimis is part of the audio group, and do any other permission restrictions on alsamixer or other commands.

satimis 09-29-2005 01:13 AM

Hi Dark_Helme,

Tks for your advice.

Performed following steps;

# nano /etc/group
deleted: # audio:!:11:satimis:
added; audio:x:11:satimis

# ls -l /usr/bin/alsamixer
Code:

-rwxrwxr-x  1 root root 61555 Sep 20 06:59 /usr/bin/alsamixer
# chown root:audio /usr/bin/alsamixer
# ls -l /usr/bin/alsamixer
Code:

-rwxrwxr-x  1 root audio 61555 Sep 20 06:59 /usr/bin/alsamixer
# chmod g+x /usr/bin/alsamixer

Rebooted BLFS 6.1

Now "alsamixer" can start as "user/satimis" but only a black/white screen displayed similar to running;

# chmod u+x /usr/bin/alsamixer
not colour screen.

Any advice. TIA

BR
satimis

Dark_Helmet 09-29-2005 01:22 AM

If you only want only user satimis (and root) to have execute permissions, you need to run a different chmod command. I would suggest:
Code:

# chmod 660 /usr/bin/alsamixer

I'm afraid I don't understand your second comparison. You say you get a black and white screen. Does it display vertical volume controls? If it does, then alsamixer is working. I wouldn't be concerned with it not having color. If you don't see the volume controls, then something else is wrong. Check the man page for alsamixer, see what files it writes to (if any) and make sure user satimis has write access to the necessary directories and/or files. If alsamixer wants to write to a file and can't, it may just kill itself without doing anything.

satimis 09-29-2005 01:44 AM

Hi Dark_Helmet,

Quote:

If you only want only user satimis (and root) to have execute permissions, you need to run a different chmod command. I would suggest:
Code:

# chmod 660 /usr/bin/alsamixer

bash-3.00# chmod -c 660 /usr/bin/alsamixer
Code:

mode of `/usr/bin/alsamixer' changed to 0660 (rw-rw----)
# exit
exit
$ alsamixer
Code:

bash: /usr/bin/alsamixer: Permission denied
$ su
Password:
# chmod -c 770 /usr/bin/alsamixer
Code:

mode of `/usr/bin/alsamixer' changed to 0770 (rwxrwx---)
# exit
exit
$ alsamixer

Alsamixer started.

Quote:

I'm afraid I don't understand your second comparison. You say you get a black and white screen. Does it display vertical volume controls....
Yes, it did, working normally. Volumn can be adjusted. But the vertical bar is black. As 'root' it is coloured so that you known which level you adjust not to exceeding the red level.

satimis

Dark_Helmet 09-29-2005 01:53 AM

Quote:

# chmod -c 770 /usr/bin/alsamixer
You're correct. I made the mistake. I meant to say chmod 550 (to give root and satimis read & execute permissions). I didn't think there would be a need to have write permissions on an executable file.

As for the color, if root has a colored display and satimis doesn't, then I'd compare root's environment settings to satimis. Check the home directories of root and satimis to see if there are dot files present in one and not the other. Also check the contents of the files for differences that might explain it.


All times are GMT -5. The time now is 03:06 AM.