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

Summary of MySQL password modification methods

Methods for changing passwords before MySQL 5.7: ...

JavaScript+HTML to implement student information management system

Table of contents 1. Introduction 2. Rendering 3....

Using streaming queries in MySQL to avoid data OOM

Table of contents 1. Introduction 2. JDBC impleme...

How to decompress multiple files using the unzip command in Linux

Solution to the problem that there is no unzip co...

CSS3 changes the browser scroll bar style

Note: This method is only applicable to webkit-ba...

A brief discussion on the calculation method of key_len in mysql explain

The MySQL explain command can analyze the perform...

Common styles of CSS animation effects animation

animation Define an animation: /*Set a keyframe t...

JS object copying (deep copy and shallow copy)

Table of contents 1. Shallow copy 1. Object.assig...

Summary of 10 amazing tricks of Element-UI

Table of contents el-scrollbar scroll bar el-uplo...

Vue implements Tab tab switching

This article example shares the specific code of ...

Detailed explanation of the use of nohup /dev/null 2>&1

nohup command: If you are running a process and y...

Encapsulate a simplest ErrorBoundary component to handle react exceptions

Preface Starting from React 16, the concept of Er...

WeChat applet picker multi-column selector (mode = multiSelector)

Table of contents 1. Effect diagram (multiple col...