7

I run Fedora with GNOME and recently installed Viber for linux. It's very good and all is working just fine.

As Viber is not open-source software, I decided to run it as another user to make sure that it doesn't have access to my files without my concent, by creating a user:group viber:viber. If I try to open from inside Viber files that belong to me or any other user, it can't read them. Goal achieved but partly. Now, I stumbled against another problem, which is Viber works only with messages and when I try to make a call, it says, that it can't find neither microphone nor speakers? It feels that I know why (I run X Server (GNOME) as myself and Viber as viber:viber (user:group) ).

How to make Viber run as viber:viber and at the same time, to let it use microphone and speakers, while running GNOME session as myusername:myusername?

SELinux solutions are also welcome but with concrete examples! chroot is not the solution, as it will lead, as I understand, to the same problem as described above.

EDIT 1:

The exec for running it is: su - viber -c /opt/viber/Viber

3 Answers 3

4
+50

You need to run pulseaudio in system mode, and let all users access it, unfortunately, this is strongly discouraged by the upstream Pulseaudio developers.

Here's a systemd service script that should improve on the above:

# /etc/systemd/system/pulseaudio.service:
[Unit]
Description=PulseAudio Daemon
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
PrivateTmp=true
ExecStart=/usr/bin/pulseaudio --system --disallow-exit

If you want to run with SELinux enabled, here is a post describing the SELinux rules needed.

1
  • Robbat, thanks for your helpful hint about Pulseaudio. Though Fedora doesn't have such settings! Fedora's configs are located in /etc/pulse/. I have managed to solve my problem without running it in System Mode. Take a look at my answer! +1 for giving a push to the right direction!
    – Ilia Ross
    Dec 9, 2013 at 9:23
4

I wasn't aware of Pulseaudio running on Fedora as audio server.

After researching, I have finally found a way to share audio (microphone and speakers) among other users, while running Pulseaudio as normal user (myself) and not in System Mode.

In order to do that you will only need to copy initial configuration file to your home directory:

cp /etc/pulse/default.pa  ~/.pulse/default.pa

Afterwards, add the following configuration option to it (~/.pulse/default.pa):

load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1

Now, under those users/user, that you want to share the audio with, in their home directories (NOT YOURS) create Pulseaudio custom user-config file ~/.pulse/client.conf and add the following option:

default-server = 127.0.0.1

Don't forget to restart your audio server or your computer/server to apply new settings.

Eventually, I can run Viber as another user viber:viber and have access to microphone and speakers, while running GNOME session as myusername:myusername.


Successfully tested on Fedora 20.

1

Careful, /opt/viber/Viber has SUID and GUID bits set. It will probably run as root nevertheless (I did not test it, though).

3
  • Interesting point, but it's only valid, if files were owned by root. I don't leave Viber files owned by root and assigned separate user/group for it. It can't run as root if the files owned by another user, right?
    – Ilia Ross
    Apr 22, 2014 at 17:59
  • I think in your case, you are fine. Standard installation procedure of todays viber.deb file (2014-04-23) is to copy the files to /usr/share/viber (which usually requires root privileges) and then do a "chmod a+s" on "Viber" and "Viber.sh". Maybe this should be mentioned, to not lead unexperienced users to false sense of security.
    – Seb
    Apr 23, 2014 at 16:35
  • I didn't install .deb package as I have .rpm. I just unpacked it. Besides never ran Viber.sh. I think it din't break the jail I made for it.
    – Ilia Ross
    Apr 23, 2014 at 17:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .