# ssh as a local user {Linux}



## shuxuef (Mar 14, 2012)

Hi, there.

I am not familiar with networking at all. But here is a probably easy question:

I have a computer with FreeBSD, and another one with Linux (on which I don't have an administrator privilege). If I log in to the Linux machine, I can control the sound card (adjusting the volume, etc). What I want to do is to log into the Linux machine using my FreeBSD via SSH to control the sound card (for example, to play some sound file on that Linux machine to remind the person at the console of something). 

If I log in the Linux machine locally first, and then ssh to it using the FreeBSD machine, I would be able to control the sound card. But if I don't log in beforehand, then I cannot do anything about the sound card (especially when someone else is logged in).

Is it some sort of default behavior of the SSH? Is it possible to realize this with the administrator privilege?

Thank you!


----------



## fonz (Mar 14, 2012)

shuxuef said:
			
		

> Is it some sort of default behavior of the SSH? Is it possible to realize this with the administrator privilege?


I doubt that ssh cares about your sound card  I suspect that the Linux machine has been setup such that a user who logs in on the console is given ownership of the sound card's device files (e.g. /dev/dsp, /dev/audio or whatever they're called in Linux). You might want to verify this. If it is indeed the case, I don't think there's much you can do without admin privileges.

Hope this helps,

Fonz


----------



## shuxuef (Mar 14, 2012)

fonz said:
			
		

> I doubt that ssh cares about your sound card  I suspect that the Linux machine has been setup such that a user who logs in on the console is given ownership of the sound card's device files (e.g. /dev/dsp, /dev/audio or whatever they're called in Linux). You might want to verify this. If it is indeed the case, I don't think there's much you can do without admin privileges.
> 
> Hope this helps,
> 
> Fonz



The only difference I found is the ownership of device 'console'. When I log in via ssh, I don't have the ownership. I guess I can't really do anything then.


----------



## Hawk (Mar 14, 2012)

I used to do something like this when I had a roommate and the entertainment system was piped through my server, that way if they ever played something too loud, I could ssh in and control the volume from another room. I believe you're looking for a volume control set from the terminal. man mixer() controls the volume like I mentioned. There are also some console based media players for playing music from the terminal as well.


----------



## shuxuef (Mar 14, 2012)

Hawk said:
			
		

> I used to do something like this when I had a roommate and the entertainment system was piped through my server, that way if they ever played something too loud, I could ssh in and control the volume from another room. I believe you're looking for a volume control set from the terminal. man mixer() controls the volume like I mentioned. There are also some console based media players for playing music from the terminal as well.



Thanks, Hawk. I know how to control the volume when I log in the Linux machine, using either command line tools or GUI tools. The problem is when I use ssh and the Linux machine has someone else logged in, I don't seem to have the privilege. I think it's the reason mentioned by fonz: the machine is configured this way. So I don't think I can do much.


----------



## fonz (Mar 14, 2012)

shuxuef said:
			
		

> I guess I can't really do anything then.


You could ask on a Linux forum (e.g. LinuxQuestions), just to be sure.

Does make sense, though. Having remote access to the sound card when somebody else is sitting at the console has way too much potential for practical jokes  It's the digital version of the whoopee cushion; admin's prerogative :e

Fonz


----------



## shuxuef (Mar 14, 2012)

fonz said:
			
		

> You could ask on a Linux forum (e.g. LinuxQuestions), just to be sure.
> 
> Does make sense, though. Having remote access to the sound card when somebody else is sitting at the console has way too much potential for practical jokes  It's the digital version of the whoopee cushion; admin's prerogative :e
> 
> Fonz



Agreed. Thanks again.


----------



## Hawk (Mar 14, 2012)

I just tested this on my Linux box and got 

```
[ ryan@jim ~]$ alsamixer
ALSA lib pulse.c:229:(pulse_connect) PulseAudio: Unable to connect: Access denied
 
Cannot open mixer: Connection refused
[ ryan@jim ~]$
```

Like fonz mentioned, this appears to be a Linux issue better suited for one of their forums. You might also want to copy any relevant output, as it would help others figure out where the issue lies (like my code box above).


----------

