Giter VIP home page Giter VIP logo

local-security-policy's Introduction

local-security-policy

Command line management of Local Security Policy on Windows

Existing tools (gpedit.msc & secpol.msc) allow you to manage Local Secutiry Policies. But these are not available on all editions of Windows, notably the Home edition. There are unsupported ways to get around this limitation but may be hazaous to your system and may not work anyway.

When you just want to enable one policy on your personal PC even the existing tools can be a bit of overkill.

Why?

I wanted to use Erlang's file:make_link/2 on Windows in the context of rebar3 and relx releases.

But, users need SeCreateSymbolicLinkPrivilege or Run as Administrator to make symbolic links. This tool allows us to add that privilege with lsp /A user SeCreateSymbolicLinkPrivilege.

NOTE: Users in the Administrators group are not helped by giving them this privilege , they still need to Run as Administrator or accept a UAC prompt to make symbolic links.

I am trialing non-Administrator user account (recommended by Windows) with SeCreateSymbolicLinkPrivilege that gives me easy access to symbolic links and a special Administrator user (with its own password) for use when elevating to an Administrator. A bit of extra typing (the admin passwor) when accepting a UAC prompt , but maybe that is more secure as well.

The command line

> lsp
Manage local security policy

LSP /P <privilege>            List accounts with privilege

LSP /U <user>                 List privileges for user

LSP /A <user> <privilege>     Add privilege to user

LSP /R <user> <privilege>     Remove privilege from user

Remember to use this command inside an elevated command prompt (Run as Administrator).

Installation

This application can be compiled with make and gcc for Windows.

Clone this repository, run make in your cloned folder.

Run the lsp.exe directly from your cloned folder or copy it to a folder in your PATH.

Example

This example adds SeCreateSymbolicLinkPrivilege to user on computer called USER-PC.

Insde an elevated command prompt (Run as Administrator), execute:

> lsp /A user SeCreateSymbolicLinkPrivilege
Adding SeCreateSymbolicLinkPrivilege to USER-PC\user

To apply the new policy immediately, execute:

> gpupdate
Updating policy...

Computer Policy update has completed successfully.
User Policy update has completed successfully.

local-security-policy's People

Contributors

emtenet avatar

Stargazers

John avatar

Watchers

 avatar

Forkers

fcccode

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.