bob12603
Posts: 25
Joined: Mon Oct 06, 2014 9:16 pm

Can I sudo startx but then run Chromium as not root?

Thu Nov 06, 2014 9:08 pm

I have Chromium and I'd like to use it via the desktop. But I use sudo startx to start the desktop because so many more things work that way. But when I then try to start Chromium it says that Chromium can't run as root. (I know that in fact it can but I also know that that's a really bad idea.) So ... is there some way to start Chromium via the desktop (started via sudo startx) but have it run under some user other than root?

Thanks, Bob

whoami
Posts: 64
Joined: Fri Nov 15, 2013 1:41 pm

Re: Can I sudo startx but then run Chromium as not root?

Thu Nov 06, 2014 9:38 pm

Does this work:

Code: Select all

su -c chrome -s /bin/sh username

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Can I sudo startx but then run Chromium as not root?

Fri Nov 07, 2014 11:54 am

But I use sudo startx to start the desktop because so many more things work that way.
Can you elaborate on that ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
RaTTuS
Posts: 10555
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Can I sudo startx but then run Chromium as not root?

Fri Nov 07, 2014 11:57 am

running x as sudo is really not the way you want to go
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
ReBoot
Posts: 147
Joined: Mon Sep 17, 2012 2:23 pm
Location: Germany
Contact: Website

Re: Can I sudo startx but then run Chromium as not root?

Tue Nov 11, 2014 10:26 am

Suggestion: use raspi-config to tell the system to boot to desktop and start Chromium from there. Viola!

DirkS
Posts: 10345
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Can I sudo startx but then run Chromium as not root?

Tue Nov 11, 2014 10:32 am

ReBoot wrote:Suggestion: use raspi-config to tell the system to boot to desktop and start Chromium from there. Viola!
I think you missed the point here...

Gr.
Dirk.

Return to “Raspberry Pi OS”