How to Get SID of user

In Windows environment, each user is assigned a unique identifier called Security ID or SID, which is used to control access to various resources like Files, Registry keys, network shares etc. We can obtain SID of a user through WMIC USERACCOUNT command. Below you can find syntax and examples for the same.

Get SID of a local user

wmic useraccount where name=’username’ get sid

Get SID for current logged in user

wmic useraccount where name=’%username%’ get sid

Find username from a SID

wmic useraccount where sid=’S-1-3-12-1234525106-3567804255-30012867-1437′ get name

How to connect as root using WINSCP – Ubuntu

In Ubuntu and other Linux distribution the “root” user is not directly accessible with a login operation without first doing an intermediate login with an unprivileged user.

Luckily, you can configure WinSCP to log in automatically from an unprivileged user into the “root ” user, by following these simply steps:

  • log into the system and become “root” via su or sudo;
  • launch the command “visudo“and configure it to allow other users to became “root” without a password by adding the following line;

user ALL = (ALL) NOPASSWD: ALL

the string “user” must be changed with the name of your regular unprivileged user;

  • Finally, to save and exit visudo (vi editor), enter the command;

:wq

  • Then change the following option into the WinSCP program: “Environment>> SCP >> Shell” from “Default” in;

sudo su –

Now try to login with WinSCP, you will be logged in directly in as “root”.