Run firefox from terminal linux

Открытие Firefox в терминале Centos Linux

Я пытаюсь запустить Firefox из терминала на сервере, используя операционную систему Centos. Всякий раз, когда я набираю команду:

Я могу заставить Firefox успешно открыться, но я не могу удаленно подключиться к серверу и открыть Firefox. Я получаю следующее сообщение об ошибке после указания экспорта DISPLAY =:0 и ввода «firefox»

Есть много форумов по этой проблеме в Интернете, и единственные полезные предложения, которые я попробовал:

Хотя мне нужен firefox для открытия под конкретным пользователем, он также не открывается под root.

2 ответа 2

Обычно в доверенной сети (т. Е. Домашней сети и т.д.) Вы можете

Это включает управление хостом X11 для вашего локального дисплея. Это позволяет подключению X11 от имени хоста удаленного хоста подключаться к локальному серверу X11.

Помните, что управление хостом X11 является старым, старым механизмом, который по своей природе не является безопасным. Он предоставляет элементарные средства контроля доступа через IP-адреса или разрешение имен хостов. Вот почему вы используете ssh для подключения к удаленному хосту: он шифрует все данные и защищает соединение точка-точка.

В этом случае это не понадобится, поскольку ваша удаленная среда должна быть (разумно) настроена на разрешение доступа по IP через устройство обратной связи. Но это перечислено здесь для справки.

Когда ssh подключается и вы указываете переадресацию X11 через ключ -x , на контуре обратной связи (адрес 127.0.0.1) будет сделана привязка для дисплея номер 10 (обычно это значение по умолчанию, хотя его можно изменить). Переменная окружения DISPLAY обычно используется для переадресации соединения программы X11 на другой дисплей или компьютер.

Итак, мы эффективно устанавливаем переменную окружения, которая сообщает firefox подключиться к поддельному дисплею 10.0, находящемуся на 127.0.0.1, который ssh затем туннелирует назад к вашему локальному дисплею X11.

Источник

How To Run Firefox From The Command Line

Firefox Start Browser From The Command Line

You can find out full path to firefox with the following type command:
type -a firefox
To open the browser, enter:
$ firefox
OR
$ /usr/bin/firefox

Firefox Open URL

To open URL in a new tab, enter:
$ /usr/bin/firefox —new-window http://www.cyberciti.biz/
To open URL in a new window, enter:
$ /usr/bin/firefox www.cyberciti.biz

Unix / Linux run Firefox from the command line

Linux Firefox open url in a new tab

You must run:
firefox —new-tab url
/usr/bin/firefox —new-tab https://www.nixcraft.com/

Firefox Search option

You can search words (term) with your default search engine, enter:
$ /usr/bin/firefox —search «term»
$ /usr/bin/firefox -search «linux add user to group»

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard
Читайте также:  Windows server не разрешает установку

Join Patreon

Open Firefox Options / Preferences

To open Firefox options/preferences window, enter:
$ /usr/bin/firefox —preferences

Set Firefox As Default Browser

To set the Firefox app as the default browser, enter:
$ /usr/bin/firefox —setDefaultBrowser

How Do I Run Firefox Remotely On Server?

SSH is frequently used to tunnel insecure traffic over the Internet in a secure way. You can login to remote server using the ssh client:
$ ssh -X user@server42.nixcraft.com
To run firefox, enter:
$ /usr/bin/firefox &
$ /usr/bin/firefox www.cyberciti.biz

How to run Firefox from a remote server

You need terminal and Gnome/KDE GUI to work with the local desktop. However, if you need to run Firefox on a remote Linux server and get output on a local desktop, try the ssh command:
ssh -X vivek@server1.cyberciti.biz firefox www.cyberciti.biz
One can specify X display to use:
firefox —display=DISPLAY url
firefox —display=0.0 url
DISPLAY=some-desktop:0.0 firefox url
ssh -X vivek@server1.cyberciti.biz «firefox —display=0.0 www.cyberciti.biz»

How to find out all other Firefox command line options?

Run the following command and you can filter outputs using the grep command/egrep command:
firefox —help
firefox —help | grep search

Источник

4 Ways to Install Mozilla Firefox in Ubuntu

Mozilla Firefox is the official Internet browser for Ubuntu, therefore, most Ubuntu distros have it installed by default. If your system lacks this browser due to any reason or if you have accidentally deleted it, we will tell you how to install it on your Ubuntu. In this article, we will describe the following ways to install Mozilla Firefox on your system. You can then make a choice based on the source you want to install Firefox from and also if you want to use the UI or the command line.

  • From the Snap Store-through the Ubuntu Software Manager
  • From the Official Ubuntu Repository-through the command line
  • From the Mozilla PPA repository-through the command line
  • From Mozilla.org website-through the command line

We have run the commands and procedures mentioned in this article on a Ubuntu 18.04 LTS system.

Method 1: From the Snap Store-through the Ubuntu Software Manager

For a person who does not want to open the Command Line much, installing a software present in the Ubuntu repository through the UI is very simple. On your Ubuntu desktop Activities toolbar, click the Ubuntu Software icon.

Click the search icon and enter FireFox in the search bar. The search results will list the Firefox entry as follows:

This is the package maintained by the snap store. Click on the Firefox search entry to open the following view:

Click the Install button to begin the installation process. The following authentication dialog will display for you to provide your authentication details as only an authorized user can install software on Ubuntu.

Enter your password and click the Authenticate button. After that, the installation process will begin, displaying a progress bar as follows:

Mozilla Firefox will then be installed to your system and you will get the following message after a successful installation: Advertisement

Through the above dialog, you can choose to directly launch Firefox and even Remove it immediately for whatever reason.

Launch Firefox

Ideally, Firefox should now be available in your system Dock/Activities panel. You can also access it from the Ubuntu application launcher bar as follows, or directly access it from the applications listing:

Remove

If you want to remove Firefox that was installed using the above method, you can remove it from your system as follows:

Open the Ubuntu Software Manager and search for Firefox as follows:

You will see the Installed status in the search entry as shown above. Click this entry and then click Remove from the following view:

The system will prompt you with an Authentication dialog. The software will be removed when you provide the password for sudo user and click Authenticate on the dialog.

Читайте также:  What is linux academy

Method 2: From the Official Ubuntu Repository-through the Command Line

Firefox being the official Ubuntu browser is also available on the Official Ubuntu repository. It can be easily installed through the command line as follows:

Open the Terminal either through the Ctrl+Alt+T shortcut or the Ubuntu Application Launcher search.

Enter the following command to update your system’s repository index with that of the internet repositories:

This way you can install the latest available version of software on your system.

Then enter the following command in order to install Mozilla Firefox from the official Ubuntu repository:

Please note that only an authorized user( sudo) can add, remove and configure software on Ubuntu. Enter the password for sudo after which the installation procedure will begin.

This might take some time, depending on your Internet speed, after which Firefox will be installed on your system.

Launch Firefox

Run the following command in your Terminal in order to launch Firefox:

Remove

You can remove Firefox completely, along with any configurations you might have made, through the following command:

Otherwise, you can use the following command in order to simply uninstall Firefox:

Method 3: From the Mozilla PPA repository-through the command line

The Mozilla PPA repository includes the latest version of Firefox. Follow these steps in order to install Firefox through this PPA repository:

First, please open the Terminal either through the system Dash or the Ctrl+Alt +T shortcut

Then, enter the following command in order to add the signing key for Mozilla PPA:

Now, enter the following command to add the Mozilla PPA repository to your Ubuntu:

Please note that only an authorized user can add, remove and configure software on Ubuntu. Enter the password for sudo, after which the PPA repository will be added to your system.

Tip: Instead of typing the command, you can copy it from here and paste in the Terminal by using the Ctrl+Shift+V, or by using the Paste option from the right-click menu.

The next step is to update your system’s repository index through the following command:

This helps you in installing the latest available version of software from the Internet.

Now that you are done with all the prerequisites required to install Firefox, use the following command as sudo in order to install Mozilla Firefox on your system:

Launch Firefox

Run the following command in your Terminal in order to launch Firefox:

Remove

You can remove Firefox completely, along with any configurations you might have made, through the following command:

Otherwise, you can use the following command in order to simply uninstall Firefox:

Method 4: From the official website through the command line

If you do not have, or do not want to use any other existing browser on your system, here is how to install Firefox from the official Mozilla.org website using the command line.

Open the Terminal either through the system Dash or the Ctrl+Alt+T shortcut. Enter the following command in order to download the Firefox Setup tar.bz2 file from Mozilla.org:

The file is by default saved in the current user’s home folder.

Extract the file to the /opt folder of your Ubuntu by using the following command as sudo:

Now, create a Firefox executable in /usr/lib/ that points to the location where you extracted the .tar.bz2 file (the /opt folder). Use the following command to do so:

Launch Firefox

Run the following command in your Terminal in order to launch Firefox:

Remove

In order to remove Firefox installed through this method, run the following command as sudo in your Terminal:

You can also delete the .tar.bz2 file that you initially downloaded from the Mozilla website.

So, this was not one but four ways to install Mozilla Firefox on your Ubuntu. Enjoy browsing!

Читайте также:  Windows bluetooth l2cap interface

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Источник

Thread: How to run firefox from command line on server

Thread Tools
Display

How to run firefox from command line on server

Was a casual user of Unix 10 years ago. Have forgotten most everything. Today installed 8.04 server on a virgin disk. Then installed firefox. Tried to run firefox from command line but get error message about no display. What is correct command?

Re: How to run firefox from command line on server

Re: How to run firefox from command line on server

Hi. Which graphical environment are you running? I would advise against running Firefox as root, though.

Re: How to run firefox from command line on server

What was the exact error message? Were you logged into an X session when you tried to run Firefox?

Re: How to run firefox from command line on server

i am too sorry for providing root privilege for firefox.

You can remove it by just typing firefox without any gksudo in front of that.

Re: How to run firefox from command line on server

If you installed the server version with out adding a gui, your best bet would be links

Re: How to run firefox from command line on server

If you’re running a server install, then you probably don’t have a graphical shell to run your applications on. This code will install the standard X11 graphical shell, used for all Linux desktops. Don’t worry, this won’t give you a desktop to play with and ruin your beautiful command line shell, just give you an interface for whenever you need to run a graphical application:

EDIT: Of course, you can then proceed to run Firefox by typing the command firefox into the shell.

Also, I’m not sure if it will launch X11 for you by default. If it doesn’t, type the command startx into the shell, upon which you will be presented with X11 and a small terminal window. Then you can type firefox into that terminal, and you should be good to go.

Last edited by Sinkingships7; June 17th, 2008 at 04:11 AM .

Re: How to run firefox from command line on server

Yes, as a few other posters above me have said, Ubuntu does not use a GUI in it’s servers. Best to learn the ways around the terminal, eh?

Firefox does not run in the terminal without an X11 display, but, there is other text web browsers. The best one to use, IMO, is links2:

Re: How to run firefox from command line on server

Hi guys. I am trying to do something like the original poster. I have installed ubuntu 9.04 server (command line only) on a somewhat old laptop that I want to run Firefox and only that, just to surf the net. I installed xorg and firefox. Doing xstart gives me a terminal window in the top left of the screen, but it only uses about 1/3 of the available screen. Typing firefox in this window gives me firefox in the top left corner, still only using 1/3 of the screen. Typing firefox -width 1024 -height 768 gives the same. I also tried xinit firefox from the command line shell, same result.

I have fiddled about with /etc/X11/xorg.conf to add the highest resolution I know the screen can take (1024×768) under the Display section. Does anyone have any other tips for me as to what I can try to get the X environment to use the full screen?

The laptop has a 1024×768 screen, is a Pentium III with 256Megs of ram (thus the need for the bare bones setup). I have tried xubuntu, it is still too heavy. I also had a go at fluxbuntu and crunchbang, the former did not install correctly, and the latter was way to slow too.

Источник

Оцените статью