Hi.
This is a "continuation" of the issue of starting firefox for a diff user on a box.
If one logs into (SSH) into a remote box, and wants to start firefox on the remote machine, such that all firefox operations occur on the remote machine..
Different sites suggest setting the DISPLAY var, as well as xauth, etc.. none of which seem to work.
The local/remote are both centos/fed.
The goal: To be able to SSH into a remote box, and run a py script that initiates a py/selenium binding/process to use firefox. -This requires that the remote box be able to start/run firefox for the user that the SSH session was started as/under.
The SSH/Firefox issue: -How to SSH into the box, and start firefox?
(Already set up the keys, to allow ssh into the box vai ssh 192.168.1.4)
Tried: ssh 192.168.1.4 foo@box1# DISPLAY=0: firefox ---ERROR: cannot open display: 0:
foo@box1# export DISPLAY=0: foo@box1# firefox ---No protocol specified ---ERROR: cannot open display: 0:
This has to be simple!
Any thoughts??
On 10/19/16 12:23, bruce wrote:
Hi.
This is a "continuation" of the issue of starting firefox for a diff user on a box.
If one logs into (SSH) into a remote box, and wants to start firefox on the remote machine, such that all firefox operations occur on the remote machine..
Different sites suggest setting the DISPLAY var, as well as xauth, etc.. none of which seem to work.
The local/remote are both centos/fed.
The goal: To be able to SSH into a remote box, and run a py script that initiates a py/selenium binding/process to use firefox. -This requires that the remote box be able to start/run firefox for the user that the SSH session was started as/under.
The SSH/Firefox issue: -How to SSH into the box, and start firefox?
(Already set up the keys, to allow ssh into the box vai ssh 192.168.1.4)
Tried: ssh 192.168.1.4 foo@box1# DISPLAY=0: firefox ---ERROR: cannot open display: 0:
foo@box1# export DISPLAY=0: foo@box1# firefox ---No protocol specified ---ERROR: cannot open display: 0:
This has to be simple!
Take "ssh -X" instead of "ssh". Thos will solve your problem!
Joachim Backes
Any thoughts?? _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org
There are many pages on SSH X forwarding. I'd suggest a quick Google to find them.
However, very quickly, you need to ensure that you have
X11Forwarding yes
in your /etc/ssh/sshd_config file on the remote box
Be aware though that Firefox seems to try to be clever. I use this technique from home to access intranet web sites by first making an inbound SSH connection. However, if I already have Firefox running locally, then try to start a remote Firefox via the SSH connection, it seems to want to action it via the local Firefox instance
On Wednesday 19 October 2016 11:23:32 bruce wrote:
Hi.
This is a "continuation" of the issue of starting firefox for a diff user on a box.
If one logs into (SSH) into a remote box, and wants to start firefox on the remote machine, such that all firefox operations occur on the remote machine..
Different sites suggest setting the DISPLAY var, as well as xauth, etc.. none of which seem to work.
The local/remote are both centos/fed.
The goal: To be able to SSH into a remote box, and run a py script that initiates a py/selenium binding/process to use firefox. -This requires that the remote box be able to start/run firefox for the user that the SSH session was started as/under.
The SSH/Firefox issue: -How to SSH into the box, and start firefox?
(Already set up the keys, to allow ssh into the box vai ssh 192.168.1.4)
Tried: ssh 192.168.1.4 foo@box1# DISPLAY=0: firefox ---ERROR: cannot open display: 0:
foo@box1# export DISPLAY=0: foo@box1# firefox ---No protocol specified ---ERROR: cannot open display: 0:
This has to be simple!
Any thoughts?? _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org
aha...
ok.. think i've got a partial solution.
as root xhost + --not exactly sure what this does -- need to reseach, but it appears to allow other users/processes access to the x env.. (this explanation is prob waaaaay wrong!!)
login as user foo su - foo
do a 'firefox -p -no-remote" -create a "new" profile to use as user foo, check the box to use this when firing up firefox -save
from the cmdline do "export DISPLAY=:0"
you can now from a term for user foo... simply do firefox & and it should display
Need to check the bashrc (or whatever gets used at startup) to have this done each time ssh is used/foo is logged in..
On Wed, Oct 19, 2016 at 6:29 AM, Gary Stainburn gary.stainburn@ringways.co.uk wrote:
There are many pages on SSH X forwarding. I'd suggest a quick Google to find them.
However, very quickly, you need to ensure that you have
X11Forwarding yes
in your /etc/ssh/sshd_config file on the remote box
Be aware though that Firefox seems to try to be clever. I use this technique from home to access intranet web sites by first making an inbound SSH connection. However, if I already have Firefox running locally, then try to start a remote Firefox via the SSH connection, it seems to want to action it via the local Firefox instance
On Wednesday 19 October 2016 11:23:32 bruce wrote:
Hi.
This is a "continuation" of the issue of starting firefox for a diff user on a box.
If one logs into (SSH) into a remote box, and wants to start firefox on the remote machine, such that all firefox operations occur on the remote machine..
Different sites suggest setting the DISPLAY var, as well as xauth, etc.. none of which seem to work.
The local/remote are both centos/fed.
The goal: To be able to SSH into a remote box, and run a py script that initiates a py/selenium binding/process to use firefox. -This requires that the remote box be able to start/run firefox for the user that the SSH session was started as/under.
The SSH/Firefox issue: -How to SSH into the box, and start firefox?
(Already set up the keys, to allow ssh into the box vai ssh 192.168.1.4)
Tried: ssh 192.168.1.4 foo@box1# DISPLAY=0: firefox ---ERROR: cannot open display: 0:
foo@box1# export DISPLAY=0: foo@box1# firefox ---No protocol specified ---ERROR: cannot open display: 0:
This has to be simple!
Any thoughts?? _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org
-- Gary Stainburn Group I.T. Manager Ringways Garages http://www.ringways.co.uk
On Wed, 2016-10-19 at 11:29 +0100, Gary Stainburn wrote:
Be aware though that Firefox seems to try to be clever. I use this technique from home to access intranet web sites by first making an inbound SSH connection. However, if I already have Firefox running locally, then try to start a remote Firefox via the SSH connection, it seems to want to action it via the local Firefox instance
That can be avoided by using "firefox -no-remote" as your command to start Firefox. While the name of the option sounds counter-intuitive, think of it as your command to run a new instance of Firefox, as opposed to remotely controlling an already running instance (such as loading a new address in a tab).
When you run Firefox, you don't actually run it directly, you're calling its handler program. That handler is making a decision about how to use Firefox.
See: man firefox
On 10/19/2016 07:35 AM, Tim wrote:
On Wed, 2016-10-19 at 11:29 +0100, Gary Stainburn wrote:
Be aware though that Firefox seems to try to be clever. I use this technique from home to access intranet web sites by first making an inbound SSH connection. However, if I already have Firefox running locally, then try to start a remote Firefox via the SSH connection, it seems to want to action it via the local Firefox instance
That can be avoided by using "firefox -no-remote" as your command to start Firefox. While the name of the option sounds counter-intuitive, think of it as your command to run a new instance of Firefox, as opposed to remotely controlling an already running instance (such as loading a new address in a tab).
When you run Firefox, you don't actually run it directly, you're calling its handler program. That handler is making a decision about how to use Firefox.
See: man firefox
I've done this before. Essentially:
1. Ensure "X11Forwarding yes" is set in the REMOTE system's /etc/ssh/sshd_config file and make sure sshd has been restarted to read it.
2. Run "xhost +" as root on the LOCAL system to permit everyone to make connections to the LOCAL system's X server.
2. "su - unprivileged-user-name" on the LOCAL machine.
3. "ssh -X user@REMOTEHOST" to log into the REMOTE machine.
4. Verify you have a DISPLAY variable set by doing "echo $DISPLAY" on the REMOTE machine. You should get a value like "localhost:10.0", indicating you have X forwarded.
5. Run "firefox" on the REMOTE machine. The display should pop up on your local machine.
This has worked for me for a long time. ---------------------------------------------------------------------- - Rick Stevens, Systems Engineer, AllDigital ricks@alldigital.com - - AIM/Skype: therps2 ICQ: 226437340 Yahoo: origrps2 - - - - The world is coming to an end ... SAVE YOUR FILES!!! - ----------------------------------------------------------------------
On 10/19/2016 06:38 PM, Rick Stevens wrote:
- Ensure "X11Forwarding yes" is set in the REMOTE system's
/etc/ssh/sshd_config file and make sure sshd has been restarted to read it.
- Run "xhost +" as root on the LOCAL system to permit everyone
to make connections to the LOCAL system's X server.
"su - unprivileged-user-name" on the LOCAL machine.
"ssh -X user@REMOTEHOST" to log into the REMOTE machine.
Verify you have a DISPLAY variable set by doing
"echo $DISPLAY" on the REMOTE machine. You should get a value like "localhost:10.0", indicating you have X forwarded.
- Run "firefox" on the REMOTE machine. The display should pop
up on your local machine.
I'm not sure that step 3 will be able to use the local X as "su -l" could have unset the DISPLAY variable, you may need "export DISPLAY=:0".
At step 2.5 you can check if you are able to open windows on your X e.g. by doing: xclock or DISPLAY=:0 xclock If only the second one works, you need "export DISPLAY=:0" before proceeding.
Anyway, step 2 is a little too permissive. Better: xhost +SI:localuser:xxxxx where xxxxx is your unprivileged-user-name.
Regards.
Allegedly, on or about 19 October 2016, Rick Stevens sent:
I've done this before. Essentially:
1. Ensure "X11Forwarding yes" is set in the REMOTE system's /etc/ssh/sshd_config file and make sure sshd has been restarted to read it. 2. Run "xhost +" as root on the LOCAL system to permit everyone to make connections to the LOCAL system's X server. 2. "su - unprivileged-user-name" on the LOCAL machine. 3. "ssh -X user@REMOTEHOST" to log into the REMOTE machine. 4. Verify you have a DISPLAY variable set by doing "echo $DISPLAY" on the REMOTE machine. You should get a value like "localhost:10.0", indicating you have X forwarded. 5. Run "firefox" on the REMOTE machine. The display should pop up on your local machine.This has worked for me for a long time.
It's an issue with Firefox, chiefly. It tries to be clever, and use an already (locally) running Firefox instance if there is one.
Sure, if there isn't any Firefox running at the time, then issuing the command will run Firefox on the remote computer displaying on the local machine. But, if if Firefox was already running locally, then any attempt to run Firefox, will (usually) re-use the local one.