LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-05-2016, 09:12 AM   #1
quintze
LQ Newbie
 
Registered: May 2016
Posts: 14

Rep: Reputation: Disabled
SSH port forwarding of video feed on Linux


Hello,

I plan to setup a steaming video feed on my Linux server and plan to use ssh to connect to it from a client on the internet while port forwarding the video feed from server to client on the designated forwarded port.

I was planning on using VLC to stream the video but I am not sure how I would do it from the command line since there will be no graphical video on my screen.

I am wondering if anyone has any experience with this and if they could lend any ideas as to the following:

1. I plan to use UBUNTU but was thinking about using CENTOS to learn it. For either one, is there a new version coming out soon which I could plan on using. I heard approx every 6 months Ubuntu comes out with a new version. I am most familiar with ubuntu (3 years).

2. When I install VLC via command line on the Linux server, I want to port forward the video feed via SSH to a client computer. I believe these settings should be in VLC correct? Also, I would be sending streaming data from something like - /dev/video1 and port forwarding that port info to another SSH port that I specify, correct? If you have any experience, please share. Thanks.

I am basically setting up a security video system and want to implement Linux and I have done some research and it looks like it is possible.

Let me know if I can provide more info. -Q
 
Old 07-05-2016, 10:17 AM   #2
quintze
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
I was also looking into ZONEMINDER.
 
Old 07-05-2016, 03:55 PM   #3
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
vlc provides extensive command-line support.
 
Old 07-06-2016, 10:05 AM   #4
quintze
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
I am on Ubuntu 14.04. It looks like this is the latest repository that is compatible:

As of today (2015/09/23), the latest VLC version for 14.04 Trusty provided by this repository is 2.2.1

Open terminal and run: (for 14.04)

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install vlc vlc-plugin-*
 
Old 07-13-2016, 08:10 AM   #5
quintze
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
I used MOTION as the video feed. Here is some output and also commands I used to get it done. Thanks Doug, for adding your 2 cents:

Setup UBUNTU 14 client to ssh to a UBUNTU 14 SERVER

Create a public key (pasted into server) and private key (attached to client) so the two computers can establish a connection (password authentication disabled).

On UBUNTU client, create an SSH key pair:
From terminal type:
ssh-keygen -t rsa
Save the key in the default folder is fine:
/home/user/.ssh/id_rsa
Upload the id_rsa.pub file to the remote host by logging in AS THE SAME USER you will remote into.

If password authentication is still enabled, you can connect to the ssh server, login as the user you want to connect remotely AS, and move the public key to the correct location:
cat id_rsa.pub >> ~/.ssh/authorized_keys
You will place it in the users folder that you want to log in WITH. (i.e. Joe)
Put it into /etc/ssh/sshd_config

Verify how you can login to this server:
RSAAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication no

Restart the SSH server
sudo /etc/init.d/ssh reload

Check to see if USB is plugged in correctly:
dmesg | grep -i usb
or
ls /dev/video*

INSTALL MOTION:
Joe@linux1:~$ sudo apt-get install motion

Create a hidden .motion folder under our profile and copy the config file to our profile:
mkdir .motion
sudo cp /etc/motion/motion.conf ~/.motion/motion.conf

Configure motion.conf by using the following settings:
sudo nano ~/.motion/motion.conf

daemon on
process_id_file /var/run/motion/motion.pid #note the location and create directory as needed
videodevice /dev/video0 #note the locatio of the device and make sure camera is same location
webcam_port 8081 #note the location of listening video port
output_normal off #change this to off for video streaming instead of images w motion detect

Create a folder for motion in /var/run/motion so the process ID can be created
sudo mkdir /var/run/motion
Start Motion
sudo motion

SSH into the Ubuntu server from Ubuntu client and port forward the listening video port to port 900 and view it in a web browser on the client workstation
ssh -L 9000:localhost:8081 gabriel@10.140.6.46

In web browser on the ubuntu client machine type:
http://localhost:9000
You should see the video feed in your web browser.
 
Old 07-19-2016, 12:10 AM   #6
maureenash
LQ Newbie
 
Registered: Jul 2016
Posts: 1

Rep: Reputation: 0
Create a public key (pasted into server) and private key (attached to client) so the two computers can establish a connection (password authentication disabled).
 
  


Reply



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
[SOLVED] IPtables : ssh port forwarding one port to another port issue routers Linux - Networking 7 08-07-2018 08:41 AM
Problem in remote ssh port using Port Forwarding jsaravana87 Linux - Server 1 09-27-2012 12:02 AM
Port number used by server when using dynamic port forwarding in SSH? kreeder Linux - Networking 4 11-21-2011 02:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:30 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration