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

  • 2021-06-28 14:49:17
  • OfStack

To resolve the problem that Deepin cannot start the Google Chrome browser in root users, follow the steps below.

1. Find the path to 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

stay exec -a "$0" "$HERE/chrome" "$@" End increase --user-data-dir --no-sandbox

Press Esc,: wq, quit saving, and now you can open the Chrome browser!

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

As we all know, port 80 of apache is reserved for the system. 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

Since normal users can only use ports above 1024, ports within 1024 can only be used by root users.

However, to avoid passing root users every time you start, you can solve this problem by set UID.

Do the following once to complete.

Do the following in the root user environment
cd.../apache/bin
chown root httpd
chmod u+s httpd
su - USERNAME
To the average user, pass
.../apache/bin/apachectl start

Why not chmod u+s apachectl?
Because set UID is only valid for binary files, apachectl found under tail1:
apachectl is a script file, look carefully and find the following sentence

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

The conclusion is that the apachectl script starts the entire httpd service by starting the httpd file.
cat httpd again, various unreadable garbles appear, ctrl+c after the end of output, httpd is determined to be a binary file.
Finally, chmod u+s httpd can be used. Of course, httpd belongs to root user. If not, execute:
chown root httpd is sufficient.

The same is true for nginx startup, with root user access....nginx/sbin

Then chown root nginx

chmod u+s nginx

Then it can be started by the normal user.

Again, the same is true for tomcat.

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

summary

The above is the Linux introduced to you by this site. Linux solves the problem that Deepin cannot start Google Chrome browser in root users. We hope it will help you. If you have any questions, please leave a message for me. This site will reply to you in time!


Related articles: