How can I remotely change the volume? At home I often connect my android to some speakers, to listen to internet-radio. It would like to be able to change the sound-level through a command on my laptop.

I can open an ssh shell to the phone, but I am stuck finding a command to change the volume on the android.

Is there a command to change the audio-volume on the android-shell? Or maybe there is a different approach without ssh that I missed completely?

I am running Android 4.1.

Edit

The accepted answer should work for rooted devices. I am still keen on getting an answer for an unrooted device.
Have a look at simulating keyevents on Android and search for "KEYCODE_VOLUME_UP" and "KEYCODE_VOLUME_DOWN".

Events can be generated by executing "input":  

#local shell:
input keyevent 24 #vol up
input keyevent 25 #vol down
#remotely using ssh
ssh your-phone input keyevent 24 #vol up
ssh your-phone input keyevent 25 #vol down

# 'su -c command' to make it run as root (if not already). EDIT: now escaped properly.
ssh your-phone su -c "input\ keyevent\ 24" #vol up
ssh your-phone su -c "input\ keyevent\ 25" #vol down"


Your shell needs appropriate permissions most probably to fire input events I guess. If you do public key authentication and keep your private key loaded in memory (ssh-add) you can make a wrapper script and just execute this without beeing asked for a passphrase. Note: There's a considerable overhead for both 'su' and 'input', all in all one single volume adjust takes 2.5s to complete on my HTC Desire.

EDIT2:  

shell@android:/ $ id
uid=2000(shell) gid=2000(shell) groups=1003(graphics),1004(input),[...]
shell@android:/ $ time input keyevent 24                                       
    0m0.92s real     0m0.29s user     0m0.06s system


Seems like you have to be member of the input group (here GID=2004) to have the capability to generate keyevents using 'input'. Also, I noticed that the screen has to not be locked (and/or off), because the lock would consume all keyevents eventually. Note also that the command takes almost 1 second.