Linux solves the problem that Deepin cannot start Google Chrome browser as root user

Linux solves the problem that Deepin cannot start Google Chrome browser as root user

To solve the problem that Deepin cannot start Google Chrome browser as root user, follow the steps below.

1. Find the path of Chrome

which google-chrome

If the path is: /usr/bin/google-chrome

2. Edit the google-chrome file

Open google-chrome and modify the command at the end of the file.

vim /usr/bin/google-chrome

Add --user-data-dir --no-sandbox to the end of exec -a "$0" "$HERE/chrome" "$@"

Press Esc, :wq, exit and save, and now you can open the Chrome browser!

ps: Let's see how to start Apache|Nginx with a non-root user

As we all know, port 80 of Apache is a system reserved port. If it is started by other non-root users, the following error will be reported:

(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
No listening sockets available, shutting down
Unable to open logs

Because ordinary users can only use ports above 1024, ports within 1024 can only be used by the root user.

However, in order to avoid having to go through the root user every time you start the computer, you can solve this problem by setting the UID.

You can complete it by performing the following operations at one time.

Do the following in the root user environment
cd ……/apache/bin
chown root httpd
chmod u+s httpd
su again - USERNAME
Go to the normal user and use .../apache/bin/apachectl start

Why not chmod u+s apachectl?
Because the set UID method is only valid for binary files, and tailing apachectl found:
apachectl is a script file. After careful review, I found the following sentence

HTTPD='/home/……/apache/bin/httpd'

Conclusion: The apachectl script starts the entire httpd service by starting the httpd file.
Run cat httpd again, and various unreadable garbled characters appear. Press ctrl+c to end the output, and you can tell that httpd is a binary file.
Finally, chmod u+s httpd. Of course, you must ensure that the owner of httpd is the root user. If not, execute:
Just chown root httpd.

Similarly, the same is true for starting nginx. Use the root user to enter....nginx/sbin

Then chown root nginx

chmod u+s nginx

Then you can start it through a normal user.

The same is true for tomcat.

Of course, it is also possible to modify the default port to a value greater than 1024.

Summarize

The above is what I introduced to you about Linux to solve the problem that Deepin cannot start Google Chrome browser as root user. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time!

You may also be interested in:
  • How to manually upgrade the kernel in deepin linux
  • How to install mysql database in deepin 2014 system
  • How to install mongodb in deepin 15.3 X64 system
  • How to create a quick launch icon for Ubuntu/Deepin
  • Deepin Windows XP Lite V5.8 perfect streamlined official version download address
  • deepin xp simplified version (220M) Download
  • Windows SP2 Activation-free Installation Version - DeepinXP PLUS V2 Beta Download
  • Install QGIS 3.4 on Deepin 15.11

<<:  Conventional JS processing functions for Vue Element front-end application development

>>:  How to implement mysql database backup in golang

Recommend

Detailed explanation of Nginx static file service configuration and optimization

Root directory and index file The root directive ...

A brief discussion on two methods to solve space-evenly compatibility issues

Since its launch in 2009, flex has been supported...

Detailed explanation of location and rewrite usage in nginx

1. Summary of location usage Location can locate ...

Web Design Tutorial (3): Design Steps and Thinking

<br />Previous tutorial: Web Design Tutorial...

Website Building Tutorial for Beginners: Learn to Build a Website in Ten Days

The 10-day tutorial uses the most understandable ...

Learn how to use the supervisor watchdog in 3 minutes

Software and hardware environment centos7.6.1810 ...

Mobile Internet Era: Responsive Web Design Has Become a General Trend

We are in an era of rapid development of mobile In...

How to Monitor Linux Memory Usage Using Bash Script

Preface There are many open source monitoring too...

Two implementation codes of Vue-router programmatic navigation

Two ways to navigate the page Declarative navigat...

MySQL Interview Questions: How to Set Up Hash Indexes

In addition to B-Tree indexes, MySQL also provide...

React's reconciliation algorithm Diffing algorithm strategy detailed explanation

Table of contents Algorithmic Strategy Single-nod...

Practice of using Vite2+Vue3 to render Markdown documents

Table of contents Custom Vite plugins Using vite-...

Share the responsive frameworks commonly used by web design masters (summary)

This article introduces and shares the responsive...

Split and merge tables in HTML (colspan, rowspan)

The code demonstrates horizontal merging: <!DO...

Docker installation rocketMQ tutorial (most detailed)

RocketMQ is a distributed, queue-based messaging ...