LinuxQuestions.org
Visit Jeremy's Blog.
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 12-30-2022, 12:10 PM   #1
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Rep: Reputation: Disabled
firefox on debian VPS


I have VPS running debian linux. Memory 1 GB. I prefer to use only software from the main debian repository. I would like some advice before I change my fresh install. I installed firefox by running sudo apt install -y firefox-esr. I ran firefox. Error: no DISPLAY environment variable specified. Documentation says X11 Forwarding is a fix for this, but a poor one. Better solution is Virtual Network Computing (VNC). Some specific options include vinagre, krdc, or TightVNC.

Because my remote VPS has has small resources (Memory 1 GB), I would want on it lightweight Desktop Environment (DE) such as XFCE or Mate Desktop. Install command might be sudo apt install task-xfce-desktop dbus-x11, or sudo apt install task-mate-desktop dbus-x11. I suppose the DE on my local system does not matter?
 
Old 12-30-2022, 12:47 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
A full Desktop Environment would be too much, you can get by with just one of the leaner Window Managers. However, since you are doing the display on your local computer, you don't even need any display stuff on your VPS. Just leave off X11, the WM, the DE, and only install the browser there. If you then forward X11 from the VPS with the -X option, you can run the browser on it and have the interface show up on your local system.

Code:
ssh -X vps.example.com 'firefox &'
However, that is going to run into the 1GB RAM limitation as well as be kind of slow regardless of the RAM. So you might just use the SSH client with Dynamic application level forwarding (SOCKS5) and then run your browser locally but point it to the SOCKS proxy. e.g.

Code:
ssh -D 4567 vps.example.com
That will put your SOCKS5 proxy at 127.0.0.1 on port 4567! See also the -N and -f options for the SSH client.

Or you could set up Squid, which is much more complicated.

What problem are you trying to solve?
 
Old 12-30-2022, 03:15 PM   #3
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
My VPS does not have domain name. For security in this forum, my posted IP address is altered.
My local system terminal has this prompt: debian@debian:~$
I added user on remote VPS system: adduser debian

Normally I log into VPS like this:
ssh root@35.244.195.25
root@35.244.195.25's password:

Or this:
ssh debian@35.244.195.25
debian@35.244.195.25's password:

You say to login to VPS like this?
ssh -D 4567 -N -f 35.244.195.25
debian@35.244.195.25's password:

No errors so far. But ls shows my local system.
debian@debian:~$ firefox
Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
debian@debian:~$

I suspect I did not understand your instructions. To answer your question, I would like to have a web browser on VPS, and control it from local system. In other words, fix the error I stated above.
 
Old 12-30-2022, 08:53 PM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Using SSH as a SOCKS5 proxy has three steps.

1) First connect and establish the proxy:

Code:
ssh -D 4567 -N -f debian@192.0.2.33
2) Then launch Firefox (I presume) as normal by clicking on the icon on your desktop.

3)Then, go to Edit->Setting->General->Network Settings and in that menu set SOCKS Host to 127.0.0.1 and the Port for the SOCKS Host to 4567 or whatever you had for -D above with the SSH client.

(
As a side note:
If you are using Chromium instead of Firefox, then you must either set your system-wide proxy settings using your desktop environment's own tools or else launch Chromium manually:

Code:
chromium --proxy-server="socks5://127.0.0.1:4567"
)
As for faking IP addresses for the sake of privacy in posting, see RFC 5737, section 3 where it offers several address ranges for use as examples: 192.0.2.0/24 (TEST-NET-1), 198.51.100.0/24 (TEST-NET-2), or 203.0.113.0/24 (TEST-NET-3) Addresses in those ranges are never valid and don't point to any existing system.
 
Old 12-31-2022, 01:53 AM   #5
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
Thank you. Problem solved. It works. I do not completely understand it, you may explain and re-word it if you wish. Here is the solution:

Use the SSH client with Dynamic application level forwarding (SOCKS5) and then run browser locally but point it to the SOCKS proxy. The effect will be that world wide web will see IP of VPS, not IP of local system.

ssh -D 4567 -N -f debian@192.0.2.0
debian@192.0.2.0's password:
exit

default= firefox> application menu> settings>General->Network Settings> use system proxy settings>
SOCKS Host= (blank)
SOCKS Host port= 0
OK>
firefox https://whatismyipaddress.com/
My IP Address is:

VPS= firefox> application menu> settings>General->Network Settings> manual proxy configuration>
SOCKS Host= 127.0.0.1
SOCKS Host port= 4567
OK>
firefox https://whatismyipaddress.com/
My IP Address is:

terminal:
channel 144: open failed: connect failed: open failed
channel 176: open failed: connect failed: open failed
channel 176: open failed: connect failed: open failed
channel 176: open failed: connect failed: open failed
channel 165: open failed: connect failed: Connection timed out
channel 9: open failed: connect failed: open failed
channel 5: open failed: connect failed: open failed
channel 7: open failed: connect failed: open failed
firefox
Error: no DISPLAY environment variable specified


https://www.rfc-editor.org/rfc/rfc5737.html
IPv4 Address Blocks Reserved for Documentation
Three IPv4 unicast address blocks are reserved for use in examples in specifications and other documents.
Documentation Address Blocks
The blocks 192.0.2.0/24 (TEST-NET-1), 198.51.100.0/24 (TEST-NET-2), and 203.0.113.0/24 (TEST-NET-3) are provided for use in documentation.
 
Old 12-31-2022, 02:57 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Quote:
Originally Posted by b1bb2 View Post
Use the SSH client with Dynamic application level forwarding (SOCKS5) and then run browser locally but point it to the SOCKS proxy. The effect will be that world wide web will see IP of VPS, not IP of local system.
Yes, that's the second option described in post #2 above and which is described in a bit more detail in #4.

Be sure to also use the URL about:config and search for network.proxy.socks_remote_dns and set it to "true". That way your DNS queries will also get forwarded over the proxy when the proxy is in use.
 
  


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
How to redirect all traffic from a VPS to another VPS 124748768 Linux - Networking 0 07-08-2011 10:36 AM
LXer: How To Upgrade Debian Lenny (Debian 5.0) To Squeeze (Debian 6.0) On Xen VPS LXer Syndicated Linux News 0 03-09-2011 05:20 AM
Paid Assist Request - VPS Firefox Launch No Display Error jeewiz Linux - Software 3 08-21-2009 05:07 AM
2 vps vs 1 vps bmayhem Ubuntu 0 05-04-2009 03:08 PM
Where can I download UML VPS or Xen VPS to make a virtual private server? abefroman Linux - Software 3 12-09-2005 10:00 AM

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

All times are GMT -5. The time now is 04:04 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