【Chrome】Use chrome and save user data under Debian without interface

About the User Data Folder

We all know that in the windows environment, the user data after we use the chrome browser will be saved in the C:/Users/Administrator/AppData/Local/Google/Chrome folder.
In the Linux environment, different operating systems will be saved in different paths, and this path will not be generated at the beginning, but the user data folder will be generated after you use chrome for the first time.
Then I found that in the Debian operating system, when I use the root identity to operate chrome, it will prompt an error:
use chrome to open the website: (/usr/bin/google-chrome-stable is the path where chrome is located, which can be found by the whereis google-chrome command To)
/usr/bin/google-chrome-stable http://www.baidu.com
, it prompts an error:
Running as root without --no-sandbox is not supported.
but using another identity operation, there is no error prompt.

Change user identity

Create a new user:
adduser ydx
Prompt the following to indicate that the creation is successful:

Adding user `ydx' ...
Adding new group `ydx' (1000) ...
Adding new user `ydx' (1000) with group `ydx' ...
Creating home directory `/home/ydx' ... //用户的主目录
Copying files from `/etc/skel' ...

Switch user:
su ydx

Generate user data folder

After logging in with another identity, use the chrome browser to open the page:
/usr/bin/google-chrome-stable http://www.baidu.com
you will find that a user folder is generated.
write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325875609&siteId=291194637