LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-10-2008, 10:58 AM   #1
Anithen
Member
 
Registered: Aug 2003
Location: Florida
Distribution: Slackware 12, Slackware 12.1, Slackware 12.2
Posts: 105

Rep: Reputation: 15
ssh X11 Forwarding works, but I cannot view webcam through it. - testing with spcagui


X11 forwarding has always worked, but I'm working on a project for a computer that is only going to be used for neighborhood time lapse videos and household security (using motion). I can use spcagui when I physically visit the computer and use it. I can use xawtv and mplayer to view live camera feeds, too. This is good so that I know the camera drivers (gspca) work, but here's what happens when I try using spcagui via ssh x11 forwarding:

government@egomenace:~$ spcagui
SpcaGui version: 0.3.5 date: 18 September 2005
video device /dev/video0
ERROR opening V4L interface
: Permission denied

If I try as root, I get:

SpcaGui version: 0.3.5 date: 18 September 2005
video device /dev/video0
Camera found: Logitech QuickCam EC
VIDIOCGPICT brightnes=16384 hue=0 color=0 contrast=8192 whiteness=0depth=24 palette=4
Bridge found: SPCA561
StreamId: GBRG Camera
Available Resolutions width 352 heigth 288 native
Available Resolutions width 320 heigth 240 native
Available Resolutions width 176 heigth 144 decoded
Available Resolutions width 160 heigth 120 decoded
grabbing method default MMAP asked
VIDIOCGMBUF size 2457616 frames 2 offets[0]=0 offsets[1]=1228808
VIDIOCGPICT brightnes=16384 hue=0 color=0 contrast=8192 whiteness=0depth=24 palette=4
VIDIOCGPICT brightnes=16384 hue=0 color=0 contrast=8192 whiteness=0depth=24 palette=4
VIDIOCGPICT brightnes=16384 hue=0 color=0 contrast=8192 whiteness=0depth=24 palette=4
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X connection to localhost:10.0 broken (explicit kill or server shutdown).
X connection to localhost:10.0 broken (explicit kill or server shutdown).

Now, that makes it look like root would be able to do it if I added an entry to ~/.ssh/config, like:

Host nomind
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
Protocol 2,1
user root

I don't think that will work, but I'll try it and report back. Also, I don't want root running spcagui all of the time, so even if it works I need to find a away for a normal user to do this.

Does anyone have any ideas? I don't see mention of my problem on google, so I really appreciate it.

-Anithen
 
Old 06-10-2008, 11:36 AM   #2
Anithen
Member
 
Registered: Aug 2003
Location: Florida
Distribution: Slackware 12, Slackware 12.1, Slackware 12.2
Posts: 105

Original Poster
Rep: Reputation: 15
Alright, my setup denies x11forwarding to all except those listed in .ssh/config. I added root there (on both machines for the experiment, just to make sure) and restarted sshd on both computers. That idea didn't work. I actually get the same root error that I got before.

Why don't I just allow the camera to take auto snapshots with camE for the timelapse? I might do that, but getting a live feed is preferred in some instances. These cameras are on the same usb bus, so they won't work at the same time, so I'll be having motion running continuously with one camera, and then if I use spcagui via ssh it will be in a wrapper script that produces the motion kill file to stop motion before starting the live feed of outside. It would be different from where motion is looking. I'm not sure, but I believe that if I cannot get spcagui working through x11 forwarding, that I will also not be able to halt motion and start something like camE to take snapshots on the fly, because the error indicates that the user is not able to access the v4l interface, not even referring to an X problem.

So, after work I'll be trying:

-Looking back at this post for answers
-Using ssh to start camE daemon, after which I could run feh on a batch or something similar.
-Reading V4L documentation
-I've already tried this on different computers with same outcome
-New google search strings for answers


Thanks for any help you guys can give,
Anithen
 
Old 06-10-2008, 11:50 PM   #3
Anithen
Member
 
Registered: Aug 2003
Location: Florida
Distribution: Slackware 12, Slackware 12.1, Slackware 12.2
Posts: 105

Original Poster
Rep: Reputation: 15
I hit up a couple of v4l articles while @ work, and saw that -- no matter what the project -- people who experienced any sort of permission denied message for a /dev/video* or any other v4l interface were mostly able to fix it with chmod 666 /dev/video0 .

I ran chmod 666 on /dev/video1 and video0, and everything's fine now. Enjoy!
 
Old 06-11-2008, 11:34 AM   #4
Anithen
Member
 
Registered: Aug 2003
Location: Florida
Distribution: Slackware 12, Slackware 12.1, Slackware 12.2
Posts: 105

Original Poster
Rep: Reputation: 15
RE: Solution

chmod 666 /dev/video* works for webcam viewing via ssh x11 forwarding, but here's a note to all who read this -- a pitfall warning:

If you ls -l /dev/video0 and /dev/video1, you will notice that it looks like everyone has read, write and execute privileges. I almost didn't even try chmod 666 because of this. I thought to my self "doing that would make them the same as they are now." I ran the command, checked ls -l on the devs and the permissions looked IDENTICAL.

Tried spcagui, and it worked, though. Just goes to show that sometimes experimentation is the only way, because if I would've just followed my head and eyes, I would've skipped the chmod 666.
 
Old 06-13-2008, 03:47 AM   #5
Anithen
Member
 
Registered: Aug 2003
Location: Florida
Distribution: Slackware 12, Slackware 12.1, Slackware 12.2
Posts: 105

Original Poster
Rep: Reputation: 15
Another, more secure solution

I made a user with adduser and made him part of the audio and video group. That allowed him to access /dev/video*. Strangely, after doing that all users were able to access the dev. I haven't tried reproducing this, but if anyone experiences it, so have I.
 
  


Reply

Tags
chmod, forwarding, gspca, v4l, webcam, x11, x11forwarding


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help forwarding X11 via SSH buckwheat12 Linux - Networking 15 05-02-2007 03:08 PM
X11 forwarding with ssh rhermsen Slackware 2 10-27-2006 01:49 PM
root ssh X11 forwarding kpachopoulos Linux - Networking 6 04-30-2006 09:51 AM
Need HELP SSH X11 Forwarding wylie1001 Linux - Software 2 04-11-2006 08:12 PM
X11 forwarding over SSH SirSlappy Linux - Networking 1 10-18-2005 01:37 PM


All times are GMT -5. The time now is 12:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration