Always run a program in administrator mode in Windows 10. If you're sick of seeing those UAC pop-ups, you can get rid of them by setting programs to run in administrator mode by default. The game needs admin access because it uses certain.net functions to run as well as writing to the hard drive both in program files (if the game is installed there) and also in the user/local folder, which requires admin rights.
Avoid running graphical applications as root if possible, see #Circumvent running graphical apps as root.
Circumvent running graphical apps as root
sudoedit
To edit files as root, use sudoedit.
GVFS
Access to privileged files and directories is possible through GVFS by specifying the admin
backend in the URI scheme[2][3], e.g.:
or
Ctrl+l
and then prepend the admin://
scheme to the resource path. The same effect can be attained via the Other locations server address bar.Xorg
By default, and for security reasons, root will be unable to connect to a non-root user's X server. There are multiple ways of allowing root to do so however, if necessary.
The proper, recommended way to run GUI apps under X with elevated privileges is to create a Polkit policy, as shown in this forum post. This should however 'only be used for legacy programs', as pkexec(1) reminds. Applications should rather 'defer the privileged operations to an auditable, self-contained, minimal piece of code that gets executed after doing a privilege escalation, and gets dropped when not needed'[4]. This may be the object of a bug report to the upstream project.
Punctual methods
Those methods wrap the application in an elevation framework and drop the acquired privileges once it exits:
- kdesu(1) (from kde-cli-tools)
- sudo (must be properly configured)
- suxAUR (wrapper around su which will transfer your X credentials)
Alternate methods
These methods will allow root to connect to a non-root user's X server, but present varying levels of security risks, especially if you run ssh. If you are behind a firewall, you may consider them to be safe enough for your requirements.
Run As Administrator Windows 10
Xhost
Xhost can be used to temporarily allow root access.
Permanently allow root access
- Method 1: Add the line
to /etc/pam.d/su
and /etc/pam.d/su-l
. Then switch to your root user using su
or su -
.
- Method 2: Globally in
/etc/profile
Add the following line to /etc/profile
:
This will permanently allow root to connect to a non-root user's X server.
Or, merely specify a particular app:
where appname
is the name of the particular app. (e.g. kwrite)
Wayland
Trying to run a graphical application as root via su, sudo or pkexec in a Wayland session (e.g. GParted or Gedit), will fail with an error similar to this:
Before Wayland, running GUI applications with elevated privileges could be properly implemented by creating a Polkit policy, or more dangerously done by running the command in a terminal by prepending the command with sudo
; but under (X)Wayland this does not work anymore as the default has been made to only allow the user who started the X server to connect clients to it (see the bug report and theupstreamcommits it refers to).
Avoid running graphical applications as root if possible, see #Circumvent running graphical apps as root.
A more versatile though more insecure workaround allows any graphical application to be run as root #Using xhost.
Using xhost
This article or section needs expansion.
A more versatile —though much less secure— workaround is to use xhost to temporarily allow the root user to access the local user's X session[5]. To do so, execute the following command as the current (unprivileged) user:
To remove this access after the application has been closed:
Are you sure your log in account is an Admin account? Check that in Users & Groups preferences.
What are the associated permissions for the program's file in your Applications folder and what permissions are associated with Applications folder itself? They should be, respectively:
- System r/w; Wheel r/only; Everyone r/only
- System r/w; Admin r/w; Everyone r/only
Run As Administrator Windows 7
Check these and, if needed, change them by selecting the file or folder. Press COMMAND-I to open the Get Info window. The Sharing & Permissions panel is at the bottom. To make a change you first need to click on the little lock icon and authenticate with your admin password.
Download Run As Administrator
Jun 21, 2014 1:02 PM