Coder Social home page Coder Social logo

sudo's Introduction

sudo

sudo for windows

Usage

C:\>sudo cmd /c dir

Then, you'll see the UAC dialog.

Tutorials

Display contents of file which can't access from you

sudo cmd /c type secret-file.txt > accessible-file.txt

Pipe from/to stream

echo 123 | sudo my-command.exe | more

Change IP address

sudo netsh interface ip add address "Local Area Connection" 33.33.33.33 255.255.255.255

Edit hosts file

sudo notepad c:\windows\system32\drivers\etc\hosts

Create admin's console

sudo

Installation

go install github.com/mattn/sudo@latest

requirement go1.8 or later.

Or download from release tab.

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

sudo's People

Contributors

mattn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sudo's Issues

sudo stop when executing powershell.exe

Environment

windows 8.1 x64, $PSVersionTable output is here

Name                           Value
----                           -----
PSVersion                      5.0.10586.117
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.10586.117
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Steps to reproduce

execute sudo.exe powershell in cmd.exe

Expected result

boot powershell prompt, and be able to execute command.

Actual result

freeze after displaying following message.

Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

(additionally, sudo.exe powershell Get-ChildItem was worked expectedly.)

Publish to Chocolatey

It would be nice if this could be published to Chocolatey for easier installation and updating. Would there be any interest in supporting this?

Can't install

$ go get github.com/mattn/sudo
# github.com/mattn/sudo
C:\works\src\github.com\mattn\sudo\server.go:25: undefined: os.Executable

$ go version
go version go1.7.5 windows/amd64

I use windows 10

two error

windows 10

  1. sudo timeout 3 error: input redirect is not supported.
  2. environment variable is not exported to sudo process, from my con ConEmu I have executed sudo su where 'su' is an alias of ConEmuC -c %ConEmuTask% -cur_console:ad:%CD%; the output is sudo: cannot execute command: su

x86 (Win32) build

Hi!
Could you please add a Win32 (x86) build to your 0.0.1 release?

I've been struggling to find a self-contained elevated command executor for Windows that pipes output correctly, and this looks like it does this, but you only have x86_64.

Edit: I've since installed Go and built my own, with go build -ldflags="-s -w" and then ran it through upx --brute sudo so that it's only 582kb, but it would still be nice for official builds to be available for others! 👍

Attachment - sudo.exe.zip

Go really needed?

Do users really need Go installed? From what I've tinkered around with Go (and please correct me cause I could be very wrong) you can compile a binary.

Wouldn't it be easier to just release that binary?

For me right now, it seems like I need the SDK as a user, when I could go on with just a compiled binary :)

sudo.exe: cannot execute command: dir

Hi Mattn,

I am very intrested with this tool, then I pull it to my local WIndows 10x64 machine. But I got error which I mentioned in title.

Steps:
go version
go version go1.8.3 windows/amd64
go get github.com/mattn/sudo
sudo.exe dir
sudo.exe: cannot execute command: dir

Any proconditions should I do before use this tool?
Thanks in advance.

Listen on a random port

The port 8800 is hardcoded in the code. It should be possible to listen on a random, non-used port.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.