Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Disabling Sound for particular user

  1. #1
    Join Date
    May 2014
    Location
    Yerevan, Armenia
    Posts
    24

    Question Disabling Sound for particular user

    Hi there :-)

    my question is how can i disable a user playing sounds (such as youtube, audio files etc,,,) on the system?

    thanks

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,777

    Default Re: Disabling Sound for particular user

    Hello and welcome here.

    Because non of your fellow openSUSE users is clairvoyant, can you please tell us which version of openSUSE you use. And as it seems that you want this for GUI users, please tell us which Desktop Environment (KDE, Gnome, ...) is used. And if this feature must function for all DEs.
    Henk van Velden

  3. #3
    Join Date
    May 2014
    Location
    Yerevan, Armenia
    Posts
    24

    Smile Re: Disabling Sound for particular user

    Quote Originally Posted by hcvv View Post
    Hello and welcome here.

    Because non of your fellow openSUSE users is clairvoyant, can you please tell us which version of openSUSE you use. And as it seems that you want this for GUI users, please tell us which Desktop Environment (KDE, Gnome, ...) is used. And if this feature must function for all DEs.
    thanks for warm welcome ^_^
    i'm using the latest opensuse 13.1 with all updates and with pacman repository :-) im a KDE user. and yes it will be good having this functioning for all DEs..

    thanks

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Disabling Sound for particular user

    On 2014-05-03 12:56, smartalgorithm wrote:
    >
    > Hi there :-)
    >
    > my question is how can i disable a user playing sounds (such as youtube,
    > audio files etc,,,) on the system?


    Traditionally we did that by adding or removing users to the group
    "audio". But this probably does not work now. Just try, and tell us
    whatever way it goes :-)

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,777

    Default Re: Disabling Sound for particular user

    I checked that in my 13.1, but the users are not members of the group audio. Thus one can not remove them from it.
    Henk van Velden

  6. #6
    Join Date
    May 2014
    Location
    Yerevan, Armenia
    Posts
    24

    Exclamation Re: Disabling Sound for particular user

    i did it too... no one is in "audio" group :-(

  7. #7

    Default Re: Disabling Sound for particular user

    Quote Originally Posted by smartalgorithm View Post
    i did it too... no one is in "audio" group :-(
    Right.
    Your user gets the necessary permissions to access the audio device by "logind" when logging in.
    This is handled by ACLs.

    See:
    Code:
    getfacl /dev/snd/*
    getfacl: Entferne führende '/' von absoluten Pfadnamen
    # file: dev/snd/by-path
    # owner: root
    # group: root
    user::rwx
    group::r-x
    other::r-x
    
    # file: dev/snd/controlC0
    # owner: root
    # group: audio
    user::rw-
    user:wolfi:rw-
    group::rw-
    mask::rw-
    other::---
    
    # file: dev/snd/hwC0D0
    # owner: root
    # group: audio
    user::rw-
    user:wolfi:rw-
    group::rw-
    mask::rw-
    other::---
    ...
    And I don't think this is configurable.

    But maybe you can somehow get logind to _not_ treat your user's session as active, or prevent the session from being registered with logind?
    I have no idea how though...
    And it would also prohibit other things like mounting USB disks, installing updates, direct rendering (3d hardware support)...

    Well, I know _one_ way to effectively disable logind completely:
    remove the line
    Code:
    session       optional        pam_systemd.so
    from /etc/pam.d/common-session.

    Then no user should be granted any special rights by logind. You might have to change the polkit permission rules then as well though, and add specific users to certain groups like "audio" or "video".

    And if /etc/pam.d/common-session is not just a symlink but an actual file, not even an update will change it any more.
    Last edited by wolfi323; 03-May-2014 at 14:33.

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Disabling Sound for particular user

    On 2014-05-03 22:26, hcvv wrote:
    >
    > I checked that in my 13.1, but the users are not members of the group
    > audio. Thus one can not remove them from it.


    Ah. I see.
    As my setup is upgraded from version to version, my user is included. It
    was needed years ago.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Disabling Sound for particular user

    On 2014-05-03 23:36, wolfi323 wrote:
    >
    > smartalgorithm;2641099 Wrote:
    >> i did it too... no one is in "audio" group :-(

    > Right.
    > Your user gets the necessary permissions to access the audio device by
    > "logind" when logging in.


    Ah.

    > This is handled by ACLs.


    Dynamic, also.

    > And I don't think this is configurable.


    Dunno. :-?

    Code:
    cer@Telcontar:~> apropos logind
    logind.conf (5)      - Login manager configuration file
    systemd-logind (8)   - Login manager
    systemd-logind.service (8) - Login manager
    cer@Telcontar:~>
    I would look at those manuals. There is a config file at
    "/etc/systemd/logind.conf", but I don't see suitable options in the manual.




    > Well, I know _one_ way to effectively disable logind completely:
    > remove the line
    >
    > Code:
    > --------------------
    > session optional pam_systemd.so
    > --------------------
    > from /etc/pam.d/common-session.
    >
    > Then no user should be granted any special rights by logind. You might
    > have to change the polkit permission rules then as well though, and add
    > specific users to certain groups like "audio" or "video".


    Yes, and many things would stop working and you you would have to take
    actions, adding people to required groups, perhaps changing the group
    owner and permissions of some devices, which is not that trivial because
    they are dynamically created.

    Not easy...


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  10. #10

    Default Re: Disabling Sound for particular user

    Quote Originally Posted by robin_listas View Post
    > And I don't think this is configurable.

    Dunno. :-?

    Code:
    cer@Telcontar:~> apropos logind
    logind.conf (5)      - Login manager configuration file
    systemd-logind (8)   - Login manager
    systemd-logind.service (8) - Login manager
    cer@Telcontar:~>
    I would look at those manuals. There is a config file at
    "/etc/systemd/logind.conf", but I don't see suitable options in the manual.
    AFAIK, it is hardcoded _which_ ACLs get added, but maybe it's possible to exclude certain users from that automatism.

    Not easy...
    I didn't say it was easy...

    But that's the only way I can think of to achieve what the OP wants (without patching systemd/logind).

    Oh, wait.
    Maybe you just can set an ACL on login (by running a script), taking _away_ the permissions to access the audio device?
    See "man setfacl".
    But that's just an idea. I don't know right now how you would get f.e. a script to run (as root) when the user logs in.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •