This question is a bit specific and I want to do the equivalent of the following code:
# these commands must be run as root
root@server:$ useradd -m -s /bin/bash elspeth # add user named elspeth
# -m creates a home folder, -s sets elspeth to use bash by default
root@server:$ usermod -a -G sudo elspeth # add elspeth to the sudoers group
root@server:$ passwd elspeth # set password for elspeth
root@server:$ su - elspeth # switch-user to being elspeth!
elspeth@server:$
elspeth@server:$ sudo apt-get install nginx
elspeth@server:$ sudo service nginx start
I click "Run as administrator" when opening the Command Prompt, which I assume is "running as root."
I did a little research and found commands like net user (username) (pwd) which I assume are Windows equivalents. Now first, the sudo group part I am confused. I enter:
net localgroup sudo (user) /add
but get a "The specified local group does not exist." Am I to just make a new "sudo" group?
There is also the part of the code setting a user to "use bash by default" of which I do not know/understand the Windows equivalent.
Lastly for the first chunk of code, there is a su command. Would runas be the equivalent? I read that you can switch users from the command prompt on Windows through runas but then I have to specify a program to run (would it be bash in this case?)
And from what I read on StackOverflow, runas is actually the Windows equivalent to Linux's sudo, which gets more confusing for me in the second chunk of code where we have to use sudo (and for what it's worth, sudo is an unrecognized command for me).
For reference and context, this is the book I am using and the exact excerpt dealing with this code: http://chimera.labs.oreilly.com/books/1234000000754/ch08.html#_user_accounts_ssh_and_privileges