Linux solves the problem that Deepin cannot launch Google Chrome browsers in root users
To resolve the problem that Deepin cannot launch Google Chrome browsers in root users, the steps are as follows.
1. Find the path to Chrome
Which google-chrome
If the path is: / usr/bin/google-chrome
two。 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 at the end of exec-a "$0"$HERE/chrome"$@"
Press Esc,:wq to exit the save, and now you can open the Chrome browser!
Ps: let's see how to start Apache with a non-root user | Nginx.
It is well known that port 80 of apache is reserved for the system. If it is started by other non-root users, the error will be as follows:
(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 purl 80
No listening sockets available, shutting down
Unable to open logs
Because ordinary users can only use more than 1024 ports, ports less than 1024 can only be used by root users.
However, in order to avoid using root users for every startup, you can solve this problem through set UID.
It can be done by doing the following at one time.
Do the following in the root user environment
Cd... / apache/bin
Chown root httpd
Chmod Utility httpd
Then su-USERNAME
To ordinary users, through
…… / apache/bin/apachectl start is fine.
Why not chmod Utility apachectl?
Because set UID is only valid for binary files, tail apachectl finds that:
Apachectl is a script file. Looking at it carefully, we find the following sentence
HTTPD='/home/... / apache/bin/httpd'
It is concluded that the apachectl script starts the entire httpd service by starting the httpd file.
Cat httpd again, there are all kinds of unreadable garbled codes. After the output of ctrl+c is finished, it is concluded that httpd is a binary file.
Finally, chmod users httpd. Of course, make sure that the owner of the httpd is a root user. If not, execute:
Chown root httpd is fine.
Similarly, nginx startup is the same, using the root user to enter. Nginx/sbin
And then chown root nginx
Chmod Utility nginx
Then it can be started by ordinary users.
The same is true of tomcat.
Of course, it is also possible to change the default port to greater than 1024.
Summary
The above is the Linux introduced by the editor to solve the problem that Deepin can not launch the Google Chrome browser in root users. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time!