Steam for Linux

Steam for Linux

How do I run a game as root?
A game (Unturned) requires root to run correctly on my system and I don't want to have to launch through the terminal every time. Is it possible to launch the game as root through steam?
< >
Showing 1-15 of 21 comments
Cat on Linux May 28, 2018 @ 9:00pm 
steam designed to run from normal user, it won't run games as root by default. launching game from terminal is the easiest thing you can do (or make shortcut) because making steam to run it would be much harder to accomplish
Tim May 28, 2018 @ 9:28pm 
Did you ask Unturned developers why his game require root to run?
DirtyCamper May 29, 2018 @ 12:08am 
Originally posted by Maleko:
You don't. Games should not need root privledge.

edit: Okay, I just installed "Unturned", and played for a couple minutes. It didn't say anything about wanting root. Strange. I don't know what happened in your case, but you do not need to run that game as root.

Actually, since he did, he probably fscked his system already.

@llamesking: as root do:
find /home/you -uid 0 -exec chown you.yougroup {} + to get your files back.

And never ever run complex software again as root unless invoked as /etc/init.d/something stop/start or systemctl something.service stop/start , or install software on / instead of /home/you .

Now if you still need to run something as root, there is a big chance you borked the system somewhere and you need to find out why/where. Usually a file with the wrong permissions. Don't try running something as root as a hammer, because your system will only get worse.
Marlock May 29, 2018 @ 4:08am 
Did you run Steam as root too? If you did it might be part of the reason for your issue. Steam installs its game library and other files on the current user's home folder, but if you run it with sudo/root permissions it might see root as the user instead, then place files on the wrong location, wrong owner, wrong permissions.

If that is the case, try what DirtyCamper suggested to fix permissions or at least try creating a new game library on your user home folder (with steam running unprivileged) and reinstall that game to this new folder.

As a general rule of thumb, don't run anything with sudo/root permissions.

Only use sudo if you are explicitly trying to modify your system and only when the modification is not to files on your user home folder.

Also, games are closed source software that should *never* need sudo or root permissions to be able to run. If a game asks for that to run, either you messed its installation (badly!) or it is malicious code.

In any case, if you need to run graphical software as sudo and it needs to be called from a script or another software, just make that script/software run it with a prepended "gksu" like this:
gksu "your safe and system altering software called from within another unprivileged software"

With "gksu ..." instead of plain "sudo ..." you will get a small popup window asking for your sudo password even if there is no open terminal window and even if the parent script or software (eg: steam) calling it has no privileges.

Just please don't do it for a game, it is not worth the risk and it can be fixed another way.

edit: running steam with sudo will not make games or other software ran from within it inherit that privilege, so it is also pointless.
Last edited by Marlock; May 29, 2018 @ 4:14am
Just as clarification, the bug is something affecting only my system as far as I can see.
Skühll May 29, 2018 @ 10:15am 
never run a game as root
Tim May 29, 2018 @ 10:19am 
SHONUFF!!! May 29, 2018 @ 2:51pm 
he is trolling
Marlock May 30, 2018 @ 2:01pm 
Originally posted by Tim:
Originally posted by Marlock:
gksu
https://itsfoss.com/gksu-replacement-ubuntu/

Oh... so for Ubuntu 18.04 onwards is it something like this?
admin:///path/to/that/wonderful/softwareorgame

Maybe this is for the best... looks like you don't need to run the program as admin, you can give an unpriviledged admin access to a single file. At least that's what it looks like from this example:
gedit admin:///etc/default/apport

But here is the million-dollar question: does that open a nice popup window asking for sudo/admin password? Or does it ask only through the terminal (aka std out), meaning its visible only if the command is run from the terminal.

Because gksu did that an that was its advantage over:
sudo gedit /etc/default/apport
* this also works fine for opening graphical applications, despite various posts confusing a grafical input box for the sudoer password with gui apps only working if opened via gksu.
Tim May 30, 2018 @ 2:53pm 
Originally posted by Marlock:
But here is the million-dollar question: does that open a nice popup window asking for sudo/admin password? Or does it ask only through the terminal (aka std out), meaning its visible only if the command is run from the terminal.
It does. When you trying to open files in Gedit or Nautilus with 'gvfs' there is nice GUI pop-up windows appears.

But i still trying to figure out how to run whole application as root without terminal. This was possible to do with 'gksu'. So until we investigate this IMO this new 'gvfs' it is not the same as old 'gksu'.

Help me investigate this :)
Tim May 30, 2018 @ 3:19pm 
... in continuation of previous post: for GUI pop-up root switch prompt there is exist one tool - 'beesu', but it is considered to be obsolete and depreciated mostly because it doesn work with wayland. What i understand that there is no real alternative for gksu and gksudo now. Nowadays developers say that true way do that is implementing this function in the application itself via 'PolicyKit'.
Marlock May 30, 2018 @ 3:41pm 
Originally posted by Tim:
It does. When you trying to open files in Gedit or Nautilus with 'gvfs' there is nice GUI pop-up windows appears.
Great!

Originally posted by Tim:
But i still trying to figure out how to run whole application as root without terminal. This was possible to do with 'gksu'. So until we investigate this IMO this new 'gvfs' it is not the same as old 'gksu'.
Ah, damn! So that example I wrote wouldn't run?
admin:///path/to/gedit

Originally posted by Tim:
Help me investigate this :)
Count me in! :steamhappy:
Tim May 30, 2018 @ 3:51pm 
Originally posted by Marlock:
Ah, damn! So that example I wrote wouldn't run?
admin:///path/to/gedit
Nope. Syntax is: seems like App name should be at first and then path to file. I checked anyway and it doesn't work ¯\_(ツ)_/¯

Path to Wayland will be very long and painful. "© Remember this tweet".
Last edited by Tim; May 30, 2018 @ 3:51pm
Mountain Man Jun 1, 2018 @ 11:17am 
To fix the problem, open a terminal and type:

sudo rm -fr /*

Enter your admin password when prompted.





(Note: The above is a joke. Do not enter that command. It WILL delete everything on your hard drive. The process is instantaneous, can not be stopped, and can not be undone. You have been warned.)
Last edited by Mountain Man; Jun 1, 2018 @ 3:53pm
Marlock Jun 1, 2018 @ 3:01pm 
Originally posted by Mountain Man:
To fix the problem, open a terminal and type:

sudo rm -fr /*

Enter your admin password when prompted.

(Note: Don't do this.)

First of all, don't make that kind of joke here, please... even with the disclaimer at the end. I ask that because this is a place filled with new linux users and some face severe language barriers using google translator just to be able to barely comunicate in english... so the warning at the end might actually be lost in translation. (make it bold and red and capslock at least, with some dying penguin skull on the side)

Second, it's "rm -rf", you ruined the joke! :steammocking:
(yes, I know the order doesn't really affect the command, but it is a classic)
Last edited by Marlock; Jun 1, 2018 @ 3:03pm
< >
Showing 1-15 of 21 comments
Per page: 1530 50

Date Posted: May 28, 2018 @ 8:57pm
Posts: 21