5

I set up a webcam server using motion. The video is correctly streamed to Internet. Now I would like to protect the stream with a password: I don't want unknown people to spy on me! I don't know how to do this. In motion.conf, there are attributes:

  • control_authentification

To protect HTTP Control by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. This option must be placed in motion.conf and not in a thread config file.

  • netcam_userpass

For network cameras protected by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication.

I don't understand these two arguments so I tried both of them but it did not work...

clemtoy
  • 185
  • 2
  • 3
  • 8

2 Answers2

6

To setup a username and password with motion, you need to edit motion configuration file. Steps

  1. Open terminal

  2. Type sudo nano /etc/motion/motion/conf

  3. Add in a new line stream_auth_method 1

  4. Add in a new line stream_authentication username:password

  5. Ctrl + X

  6. Press Y, Press Enter

Chaf
  • 61
  • 1
  • 1
3

netcam_userpass is to connect motion to a webcam that is protected by a username and password. This can happen for instance, if you are running a webcam program on a cellphone and have set a username/pass there.

In order to protect your motion cam to the outside internet, you'd need to setup either an Apache or Nginx proxy to a cgi program (mjprox) that watches motion, with http authentication attached (htaccess / htpasswd).

Information on mjprox can be found here.

Subimage
  • 131
  • 2