[wellylug] /dev/dsp permission
Sam Cannell
plaz at addict.net.nz
Fri Jun 6 13:36:46 NZST 2003
Edouard Chalaron wrote:
>Ok things are back. The purpose was to allow any user to play sound by
>/dev/dsp...........; I failed.... :-(
>
>But I found this, which may explain my troubles (only root can play on
>/dev/dsp)
>
>"By default the script in Readme.linux that creates the sound device files
>only allows the devices to be read by user root. This is to plug a potential
>security hole. In a networked environment, external users could conceivably
>log in remotely to a Linux PC with a sound card and microphone and eavesdrop.
>If you are not worried about this, you can change the permissions used in the
>script.
>
>With the default setup, users can still play sound files. This is not a
>security risk but is a potential for nuisance."
>
>Maybe my troubles are coming from here. Where can I find this script or does
>anybody know how to correct this ?
>Thanks again
>Edouard
>
>
>
Running 'ls -lH /dev/dsp' should show you something like:
sam at sam:~$ ls -lH /dev/dsp
crw-rw-r-- 1 root audio 14, 3 Jan 1 1970 /dev/dsp
(the -H tells ls to dereference the symbolic link and show the
information about the real device node)
Note the 'root audio'. The audio group is allowed to write to
/dev/dsp, which is what you want.
As the user you want to be able to access the sound device as, run the
command 'groups'.
It should display something like:
sam at sam:~$ groups
sam
That means that my user is only in the group 'sam'.
As root, run 'usermod -G audio username', where username is the user you
want to be able to access the sound device.
The -G option tells usermod to change the secondary groups that the user
is a member of. To specify more than one, for example, to allow the
user to access the modem, the command would be 'usermod -G audio,dialout
username'
Then, log out and in again. Running 'groups' now should display
something like:
sam at sam:~$ groups
sam audio
You should now be able to access /dev/dsp.
More information about the wellylug
mailing list