SSH Command in Windows with examples

Permissions and administrator commands in Windows

Control who may use a file, and run things as the administrator.

#icacls

View and change permissions

Syntaxicacls path [options]
  • icacls C:\DataCMD

    Show who may do what

  • icacls C:\Data /grant Alice:(OI)(CI)MCMD

    Give Alice Modify rights to the folder and everything in it

  • icacls C:\Data /remove BobCMD

    Remove Bob's entries

  • icacls C:\Data /reset /TCMD

    Reset to inherited permissions for everything inside

TipLetters: F = full, M = modify, RX = read and run, R = read.

#takeown

Take ownership

Syntaxtakeown /F path
  • takeown /F C:\Data /R /D YCMD

    Become the owner of a folder tree (administrator window)

#whoami

Who am I?

Syntaxwhoami [/groups] [/priv]
  • whoamiCMD

    Show DOMAIN\user

  • whoami /groupsCMD

    The groups you belong to

  • whoami /privCMD

    Your privileges

#runas

Run as another user

Syntaxrunas /user:name program
  • runas /user:Administrator cmdCMD

    Open a window as Administrator

  • Start-Process powershell -Verb RunAsPowerShell

    Open an elevated PowerShell (asks for approval)

TipTo open a CMD or PowerShell window as administrator, right-click it in the Start menu and choose Run as administrator.

#net user

Manage accounts

Syntaxnet user [name] [password] [/add]
  • net userCMD

    List accounts

  • net user Alice * /addCMD

    Add an account and type the password when asked

  • net localgroup Administrators Alice /addCMD

    Make Alice an administrator

  • net user Alice /active:noCMD

    Disable the account

  • Get-LocalUserPowerShell

    Account list in PowerShell

#gpresult / gpupdate

Group Policy

Syntaxgpresult /r
  • gpresult /rCMD

    Show which policies apply

  • gpupdate /forceCMD

    Apply policy changes now

Run these commands with SSH Command

SSH Command is a desktop app for Mac, Windows and Linux that puts a real terminal, SFTP file panes, a sudo switch and a searchable Linux command finder in one window. Type what you want to do, and send the command to your server with one click.

Download free Linux commands with examples SFTP & FTP client