LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-08-2004, 12:01 AM   #1
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Rep: Reputation: 15
changing file ownership /dev/dsp (doesnt work..)


HI,
I've got my sound working but it only works when I'm logged in as root and start xwindows(KDE3)

There was a recommendation to change the dsp sound device to a 'audio' group
and then let users be members of that group to simplify administration and security.

So i created the group audio
added my user to that group
Then...
I changed the /dev/dsp to belong to the audio group

'bash-2.05a$ ls -l dsp
crwxrwx--- 1 1002 audio 14, 3 Jul 18 1994 dsp'

But when i login as my user that is under the audio group i still
get the same dern error message!

"device /dev/dsp can't be opened permission denied.

If i'm logged in as root I don't get this and the sound very well
What i'm i missing?

Alex
 
Old 03-08-2004, 09:17 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
When you are logged as user and type "groups", does the output shows you audio group???
 
Old 03-08-2004, 02:59 PM   #3
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
Hmmm. Interesting command, thanks. Good thinking it doesn't show audio as one of my
groups, which is strange.

'bash-2.05a$ groups
users
bash-2.05a$'

I used the utlitiy called 'KDE User management' in KDE3 to create the audio group
and to add my user to that group. I went and checked again and my users is
in the audio group but it says "primary group = users " I wonder if that is causing
a problem, or maybe it is because I used the KDE user management and it didnt
work right. Here is the groups file from the system, (edited)

root::0:root
sys::3:root,bin,adm
adm::4:root,adm,daemon
tty::5:
disk::6:root,adm
lwheel::10:root
gdm::42:
nobody::98:nobody
nogroup::99:
users::100:icy
console:x:101:
audio:*:1001:icy
 
Old 03-08-2004, 04:53 PM   #4
ProtoformX
Member
 
Registered: Feb 2004
Location: Canada
Distribution: LFS SVN
Posts: 334

Rep: Reputation: 34
Why not just do this as root

chmod a+rw /dev/dsp /dev/mixer /dev/midi /dev/sequencer

now all sound works no matter what user you are.
 
Old 03-09-2004, 12:07 AM   #5
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
chmod a+rw /dev/dsp
Works but i'd still like to figure out why its not working unless my user icy has
permissions outside of him being in group audio which has permission also.

Also i've remove the read write permission for ALL to dsp making
crwxrwx--- 1 1002 users 14, 3 Jul 18 1994 dsp
And then I changed did chgrp on dsp
'chgrp users dsp'
And then my user could access /dev/dsp because he is a member of the
users group.

Anyone have an idea why my 'audio' group which owned /dev/dsp
at one time doesn't work. The user icy was a member of the audio group.

Alex
 
Old 03-10-2004, 09:59 AM   #6
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hi icehenge,

It's normal if you can't access /dev/dsp... Nonetheless everything is well configured . In fact when you try to access /dev/dsp it's with GID 100 (users one) if you don't believe me type:
Code:
[olivier@Olinux-lfs ~]$ id
uid=1000(olivier) gid=100(users) groups=100(users),11(audio)
you'll see that you belong to users and audio group but that's users id which is in use. And you can't belong to two groups at the same time because you can't have 2 different GID at the same time. So to change group type:
Code:
[olivier@Olinux-lfs ~]$ newgrp audio
[olivier@Olinux-lfs ~]$ id
uid=1000(olivier) gid=11(audio) groups=100(users),11(audio)
And you now belong to audio group so you can access /dev/dsp The annoying thing with this method is for users who hate text mode and only use graphical mode to run applications. As a matter of fact, when you start your application from your menu, default GID will be used. So you'll have to modify the way to start audio applications...
Of course there's another solution a bit less secure, but it's a good alternative. Edit /etc/login.defs file and enable this option:
Code:
# Use with caution - it is possible for users to gain permanent
# access to these groups, even when not logged in on the console.
# How to do it is left as an exercise for the reader...
#
CONSOLE_GROUPS         audio
I've never tested it but I think this'll work
A last advice, have a look at gpasswd command (and his man page)... It may be very helpful, to set or not passord for groups...

Oliv'
 
Old 03-11-2004, 02:29 AM   #7
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
Oliv'
Thank you! That was exactly the type of explanation I was looking for on why my group audio
was not working.

I haven't tried the 'newgrp audio' command but it sounds like a more secure but
tiresome route to follow.

My slackware system is only used for home use. The only service I plan
to run is SSH and this system is located behind a hardware firewall so I
'suppose' its less likely to be targeted and attacked but I love security so
thats why i'm going through all this trouble

How do you have the audio setup on your system?
Alex
 
Old 03-11-2004, 06:43 AM   #8
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
I forgot to tell you one command, that's:
Code:
sg audio -c command
On my system, it's a very simple config as I use XFCE4, I just have to go on my xmms icon for example, right-click, then properties and instead of running xmms, I run gs audio -c xmmms I have also disabled password, bec' I don't want to run my command in terminal to enter password
Another reason is that the more secure a system is, the less friendly user it is For example, have a look at IPCOP distro, that's very secure(even if they can do better), but you don't have compiler or other usefull things
Hope this help you

Oliv'
 
Old 03-12-2004, 09:48 PM   #9
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
Oliv'
Thanks for the help, I'm just starting using linux and your assistance along with everyone
else on this board is greatly appreciated. Without this type of assistance some troubles
might have gotten the better of me. Be well.
Alex
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
devfs and devfsd don't create /dev/dsp or /dev/sound/dsp ? behmjose Linux - Hardware 2 10-02-2006 01:27 PM
FC3, /dev/dsp permissions changing weirdness slyman Fedora 0 05-06-2005 02:27 AM
lsof and fuser do not work with /dev/dsp alexrait1 Slackware 4 10-09-2004 05:07 PM
/dev/dsp* keep changing back to 600 Gophy Slackware 1 03-01-2004 02:05 PM
changing ownership of downloaded file ergo_sum Linux - Newbie 2 09-19-2003 08:58 PM


All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration