Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin rights #6

Open
manzick opened this issue Feb 4, 2018 · 32 comments
Open

Admin rights #6

manzick opened this issue Feb 4, 2018 · 32 comments
Labels
enhancement New feature or request

Comments

@manzick
Copy link

manzick commented Feb 4, 2018

How can I start terminal with admin rights? As I know UWP app can't start as administrator. For example, I want to install Chocolatey Package Manager, but I see this.
image

P.S, Sorry me for my english language. =)

@felixse
Copy link
Owner

felixse commented Feb 4, 2018

I have no idea so far if this can be achieved with the limitations of UWP. You could try this: http://blog.lukesampson.com/sudo-for-windows

Would be nice to know if it works 🤔

@felixse felixse added enhancement New feature or request help wanted Extra attention is needed labels Feb 4, 2018
@manuelelucchi
Copy link

Centennial Apps can call for admin rights (see Desktop App Converter in the store) so you can maybe elevate to admin rights the Node.js part that calls the commands

@felixse
Copy link
Owner

felixse commented Feb 4, 2018

I will have a look at this, but I am afraid this will be a Microsoft exclusive thing.

FYI, there is no node.js running in the background of this App, the SystemTray is using winpty to host the shell processes. Guess I should write down something about the general architecture soon.

@felixse felixse removed the help wanted Extra attention is needed label May 23, 2018
@ghost
Copy link

ghost commented Jun 24, 2018

@felixse
Copy link
Owner

felixse commented Jun 24, 2018

There are two problems:

  1. This is not supported for UWP FullTrust processes right now (At least not until RS5)
  2. If we start SystemTray elevated every shell would be always elevated. I don't think this would be as intended.

What might work is to further encapsulate TerminalSession in a new process that we start with startInfo.Verb = "runas"; But I'm not 100% sure if this will work, needs some more investigation.

But nevertheless thanks for your effort 😃

@spurll
Copy link

spurll commented Aug 22, 2018

I'd love to run FluentTerminal as my main console emulator, but not being able to right-click and Run as Administrator is a big drawback.

@hanskokx
Copy link
Contributor

hanskokx commented Aug 22, 2018

@spurll As a temporary workaround (or, permanent?), I use the following solution: http://blog.lukesampson.com/sudo-for-windows

(as @felixse pointed out in post 2)

@felixse
Copy link
Owner

felixse commented Aug 22, 2018

We might actually be able to support elevated shells starting with the 1809 update and ConPTY

@RichardBronosky
Copy link

Has anyone found a solution yet?

@felixse
Copy link
Owner

felixse commented Sep 28, 2018

So far only the workarounds that were posted here. A real solution is dependent on 1809, which I had no chance to install yet

@tobiaskohlbau
Copy link

There exists new information within a blog series (originally anwesered within here).

Maybe there are information about how to handle this with UWP.

@ynsgnr
Copy link

ynsgnr commented Dec 2, 2018

For Chocolatey , you can give access to C:\ProgramData\chocolatey for users in "rigth click chocolatey folder>Properties>Security>Edit>Users>Tick Full Access and save by clicking OK or approving whatever prompt you get

@ynsgnr
Copy link

ynsgnr commented Dec 2, 2018

I have no idea so far if this can be achieved with the limitations of UWP. You could try this: http://blog.lukesampson.com/sudo-for-windows

Would be nice to know if it works 🤔

sudo for windows works very well

@spencerwooo
Copy link

spencerwooo commented Dec 17, 2018

For those who have UAC problems with Chocolatey, I highly suggest you try this: scoop - https://github.com/lukesampson/scoop. scoop installs software to your local user folder, and doesn't mess up PATH, so it doesn't require UAC. (Also I consider it faster than Chocolatey.)

@DBremen
Copy link

DBremen commented Mar 20, 2019

Thanks for the great app. In order to have PowerShell starting always as admin using sudo I have set the "Arguments" of the PowerShell profile to (I couldn't get environment path working and therefore hard-coded the path):
-nop -noexit -Command "YOURPROFILEPATH\scoop\shims\sudo.cmd powershell"

@TylerLeonhardt
Copy link

@ynsgnr sudo for windows works in FluentTerminal?

@pf1gura
Copy link

pf1gura commented Mar 25, 2019

@TylerLeonhardt It works for me

felixse pushed a commit that referenced this issue Apr 5, 2019
* Appveyor builds (#6)

* SSH implemented.

* Implementing SSH by using the existing app infrastructure.

* Refactored to new command instead of a profile

* Update .gitignore
mjs pushed a commit to mjs/FluentTerminal that referenced this issue Apr 16, 2019
mjs pushed a commit to mjs/FluentTerminal that referenced this issue Apr 16, 2019
* Un-swap Ubuntu yellow and cyan (felixse#291)

The build-in Ubuntu profile has the yellows and cyans swapped. This fixes that.

* Add dark and light mode SVG icons for felixse#203 (felixse#290)

* Ap/ssh Implemented SSH by using the exsting infrastructure (felixse#293)

* Appveyor builds (felixse#6)

* SSH implemented.

* Implementing SSH by using the existing app infrastructure.

* Refactored to new command instead of a profile

* Update .gitignore

* fix: new line bug in verbatim string (felixse#294)

* Read whole terminal frame at once to avoid console data append glitches (felixse#299)

* Read whole terminal frame at once to avoid console data append glitches

* Simplify calculation logic with Math.Max

* Move back referencing <None Include="FluentTerminal.App_TemporaryKey.pfx" /> since it's used during AppVeyor GitHub Releases deployment
mjs pushed a commit to mjs/FluentTerminal that referenced this issue Apr 16, 2019
* Un-swap Ubuntu yellow and cyan (felixse#291)

The build-in Ubuntu profile has the yellows and cyans swapped. This fixes that.

* Add dark and light mode SVG icons for felixse#203 (felixse#290)

* Ap/ssh Implemented SSH by using the exsting infrastructure (felixse#293)

* Appveyor builds (felixse#6)

* SSH implemented.

* Implementing SSH by using the existing app infrastructure.

* Refactored to new command instead of a profile

* Update .gitignore

* fix: new line bug in verbatim string (felixse#294)

* Read whole terminal frame at once to avoid console data append glitches (felixse#299)

* Read whole terminal frame at once to avoid console data append glitches

* Simplify calculation logic with Math.Max

* Move back referencing <None Include="FluentTerminal.App_TemporaryKey.pfx" /> since it's used during AppVeyor GitHub Releases deployment
mjs pushed a commit to mjs/FluentTerminal that referenced this issue Apr 16, 2019
* Un-swap Ubuntu yellow and cyan (felixse#291)

The build-in Ubuntu profile has the yellows and cyans swapped. This fixes that.

* Add dark and light mode SVG icons for felixse#203 (felixse#290)

* Ap/ssh Implemented SSH by using the exsting infrastructure (felixse#293)

* Appveyor builds (felixse#6)

* SSH implemented.

* Implementing SSH by using the existing app infrastructure.

* Refactored to new command instead of a profile

* Update .gitignore

* fix: new line bug in verbatim string (felixse#294)

* Read whole terminal frame at once to avoid console data append glitches (felixse#299)

* Read whole terminal frame at once to avoid console data append glitches

* Simplify calculation logic with Math.Max

* Move back referencing <None Include="FluentTerminal.App_TemporaryKey.pfx" /> since it's used during AppVeyor GitHub Releases deployment

* Dev/overlay control (felixse#278)

* Creating a control for the overlay

* using Interactivity

* trying to bind by reference

* fix bindings

* remove unused packages

* Move getter/setter to show method

* Convert to AutoProperty

* Make text copied notification configurable

* cache settings, removed unused file

* Less conflicting default keybindings (felixse#309)

Many of FluentTerminal's default keybindings collide with commonly used
default keys in various terminal apps. Use defaults that are less likely
to cause problems to provide a better out-of-the-box experience. Many of
the bindings are inspired by gnome-terminal's defaults.

Also, the `false` modifiers in the default keybinding specifications
have been removed. This makes it easier to see which modifiers are
actually in use.
@kdien
Copy link

kdien commented Jun 10, 2019

Thanks for the great app. In order to have PowerShell starting always as admin using sudo I have set the "Arguments" of the PowerShell profile to (I couldn't get environment path working and therefore hard-coded the path):
-nop -noexit -Command "YOURPROFILEPATH\scoop\shims\sudo.cmd powershell"

Nice trick but it makes the Admin PS session run inside the current session, so basically you have to type "exit" twice to completely close the shell.
I figured out another way to achieve this: Create a new terminal profile and set the path to your sudo.cmd as the executable and use "powershell" as the argument. Set this profile as default or set a keybinding and you have a "real" Admin PS session.

@Ronkiro
Copy link

Ronkiro commented Jan 9, 2020

Just a side-note for this workaround.

Choco's refreshenv command seems to not work if you started your shell with sudo.cmd.

You may need to restart the terminal if in need of an env reload.

@yujinlin0224
Copy link

New Windows Terminal can be opened as administrator, why Fluent Terminal still have this issue?

@RhavoX
Copy link
Contributor

RhavoX commented Jul 11, 2020

Hello, there is a tutorial on the web on how to achieve this: https://stefanwick.com/2018/10/07/app-elevation-samples-part-3/ is this something that will be looked into?

@felixse
Copy link
Owner

felixse commented Jul 13, 2020

I tried this back then, but I didn't find a way to integrate this with WinPty. I'm tending towards embedding https://github.com/gerardog/gsudo or doing something similar.

@xv
Copy link

xv commented Aug 1, 2020

I was ready to make this beauty my go-to software, but a terminal without admin rights isn't a proper terminal. Rather disappointing but looking forward for a future release that provides this essential capability.

@hanskokx
Copy link
Contributor

hanskokx commented Aug 1, 2020 via email

@hollowimage
Copy link

was looking for a new terminal to switch to from conemu (too many super tiny but irritating drawbacks/bugs in that) and fluent was great, but inability to run as admin is a huge deal breaker.

one additional major reason, and not just chocolatey, is WSL2 + VSCode launch in the filesystem.

it works fine in the native PS, but if i drop into wsl2 and try to launch code in current dir from wsl2 it spits out an access denied error:

/mnt/c/Program Files/Microsoft VS Code/Code.exe: Permission denied

sounds like a similar admin level issue, but maybe not. in either case, there's definitely something with permissions that's happening within this app.

some details:
windows build: 2004
wsl2 distro: ubuntu 20.04

@Githubber616
Copy link

Somehow I seem too stupid to get it working.
%USERPROFILE%\scoop\shims\sudo.cmd cmd.exe
as well as the same with the powershell insta closes the instance right after. I'm doing something wrong but am too stupid to figure out what.

@hanskokx
Copy link
Contributor

Somehow I seem too stupid to get it working.
%USERPROFILE%\scoop\shims\sudo.cmd cmd.exe
as well as the same with the powershell insta closes the instance right after. I'm doing something wrong but am too stupid to figure out what.

Rather than starting your shell with sudo, you need to invoke sudo per command.

@Githubber616
Copy link

Somehow I seem too stupid to get it working.
%USERPROFILE%\scoop\shims\sudo.cmd cmd.exe
as well as the same with the powershell insta closes the instance right after. I'm doing something wrong but am too stupid to figure out what.

Rather than starting your shell with sudo, you need to invoke sudo per command.

How?

@hanskokx
Copy link
Contributor

hanskokx commented Feb 23, 2021

How?

image

@Githubber616
Copy link

Thanks for the great app. In order to have PowerShell starting always as admin using sudo I have set the "Arguments" of the PowerShell profile to (I couldn't get environment path working and therefore hard-coded the path):
-nop -noexit -Command "YOURPROFILEPATH\scoop\shims\sudo.cmd powershell"

How do I that exactly?

@KaKi87
Copy link

KaKi87 commented Jun 5, 2021

Hello, any news on this ? Thanks

@kamusis
Copy link

kamusis commented Feb 19, 2022

I'm using Fluent Terminal, which looks more pretty than Windows Terminal.
scoop and sudo solution works for me.
Install scoop: https://github.com/ScoopInstaller/Scoop
Install sudo: http://blog.lukesampson.com/sudo-for-windows

Fluent terminal settings like this:

image

you should change the fix path "D:\Tools\scoop" to your owns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests