login as root but run script as guest
Forum rules
Please only post tutorials and HOWTOs in here. It should not be a discussion area.
Please only post tutorials and HOWTOs in here. It should not be a discussion area.
- francois
- Contributor
- Posts: 6499
- Joined: 28 Dec 2010, 14:25
- Distribution: xfce plank porteus nemesis
- Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.
login as root but run script as guest
I am working in root mode. I would like to create a script to start chromium as user guest, from one command line if possible without having to issue the password for guest. Is this possible?
Prendre son temps, profiter de celui qui passe.
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: starting package with a script for user guest
Code: Select all
su - guest -c chromium
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
Re: starting package with a script for user guest
I am not sure if that will work but in a test of mtpaint I changed to root and then ransu - guest -c chromium
Code: Select all
su -c guest mtpaint
su: user mtpaint does not exist
Code: Select all
su -c mtpaint guest
so as I don't have chromium installed I would suggest
Code: Select all
su -c chromium guest
- francois
- Contributor
- Posts: 6499
- Joined: 28 Dec 2010, 14:25
- Distribution: xfce plank porteus nemesis
- Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.
Re: starting package with a script for user guest
aus9, you have the winning combination.
Thanks to both of you.
Thanks to both of you.
Prendre son temps, profiter de celui qui passe.
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: starting package with a script for user guest
Sorry mixed the order. The correct aproach would be:
su guest -
Starts a login shell for guest with guest environment.
-c command
Runs a command for su
Code: Select all
su guest - -c mtpaint
Starts a login shell for guest with guest environment.
-c command
Runs a command for su
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.