LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2006, 04:57 PM   #1
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Rep: Reputation: 30
Question firefox from the command line


Hi,

I have an ssh -X connection to another host (say B) on my company network. I want to access a web page accessible only through B. Is there a way I can bring up a web browser like Firefox from the command line?

Thanks,
Ashlesha.
 
Old 10-09-2006, 05:32 PM   #2
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,829

Rep: Reputation: 257Reputation: 257Reputation: 257
You can bring up a remote x session over ssh and launch the browser.
 
Old 10-09-2006, 05:36 PM   #3
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
yeah but how do i do that?
 
Old 10-09-2006, 06:11 PM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
if you've connected using ssh -X B (where B is your host), then simply running firefox from the CLI should bring up a new window on your machine locally.
 
Old 10-09-2006, 06:15 PM   #5
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
the question is how do i open firefox from the CLI?
 
Old 10-09-2006, 06:16 PM   #6
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,829

Rep: Reputation: 257Reputation: 257Reputation: 257
You are on 192.168.1.0
The remote machine is 192.168.1.1


xhost +192.168.1.1 (IP of client)

ssh 192.168.1.1
login: ....
password: ....

export DISPLAY=192.168.1.0:0

$ xterm &

If you do:

CTRL+ALT+F8

There should be your x session, but you might need to run gdm or kdm to start it.
 
Old 10-10-2006, 03:30 AM   #7
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
enter the path to the firefox binary, or just try running
Code:
firefox
otherwise, you can search for firefox on your computer with either
Code:
locate firefox
or
Code:
find / -iname "*firefox*"
 
Old 10-10-2006, 12:39 PM   #8
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
Awsome Machine!
Thank you v much!
it works! except if i m logged in as root -- it gives the following error

Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
 
Old 10-10-2006, 01:26 PM   #9
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,115

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
You can run Firefox locally (not on remote machine B) and have it use machine B as a proxy. This will be faster than running FireFox on machine B and sending it's display back to your local machine via X forwarding (especially if you have a slow connection).

Check out the -D option to ssh. You configure local Firefox to use your local machine (and the local port you specified with the -D option to ssh) as a SOCKS proxy.
 
Old 10-10-2006, 01:33 PM   #10
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
thats a great tip-- i tried it:

Quote:
ssh -D 80 root@host B
I get the following msg:
Quote:
Privileged ports can only be forwarded by root.
 
Old 10-10-2006, 02:08 PM   #11
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
and i cant connect to host B!
 
Old 10-10-2006, 02:12 PM   #12
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,115

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Well, don't tell it to use port 80! That's indeed a priviledged port, as the error message says. Anything below 1024 is considered priviledged. Only root can start processes that LISTEN on priviledged ports. Just pick some other unused port above 1024.
 
  


Reply


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
how to I pass window geometry to mozilla-firefox from command line? drkstr Slackware 5 05-30-2006 11:12 PM
How do you launch Mozilla Firefox from the command line ? pppaaarrrkkk Linux - Newbie 1 10-07-2005 03:06 PM
command line options for firefox for shell scripting. dr_zayus69 Programming 1 05-25-2005 12:36 PM
Firefox and Command line clokwurk Linux - Software 8 12-01-2004 08:30 AM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 08:45 PM


All times are GMT -5. The time now is 04:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration