How to add a user via command line in Windows and Linux?
Adding a user whether in Linux or Windows requires the user have rights to create.
In Windows you must be a member of the administrator or other groups who has the rights to create a user.
In Linux you must be a root or either a member of the sudoers depending on what distro you are using.
In Windows to create a local user in a Windows client operating system such as Windows 7 or Windows 10.
A one liner command can be issued to create a local user, using the command prompt Window at an elevated mode or administrator mode.
At the command prompt type:
Net user "username" "password" /add
Net user << this should be type like that it’s part of the command syntax while username and password, can be any data and of course /add is needed meaning the command is adding a user to the system.
Example: net user spiderbond 007-homeSp!dey /add
Command will add a user name called spiderbond and the password is 007-homeSp!dey
To know more about the net command type this at the command prompt window: net /? Or net user ?
In Active Directory, you cannot use net user to add a domain user. To add a domain user, try exploring this command: dsadd user /?
In Linux to add a user type literally, adduser
Example, open terminal and type the following command:
1. adduser linuxtor
2. passwd On!onD3rkWev
The first command adduser will add a user with the name linuxtor and the passwd which is basically the short word for password will set the string On!onD3rkWev as the password for linuxtor
To find out more about the command check the manual or the man pages for the command, type:
man adduser or man passwd
Try also:
adduser --help or passwd --help
info adduser or info passwd
Till next time..Cheers!
================================
Free Android Apps:
Click on links below to find out more:
Excel Keyboard shortcuts guide
Linux Android App cheat sheet:
Multiplication Table for early learners
https://play.google.com/store/apps/details?id=com.TableMultiplication
Divine Mercy Chaplet Guide (A Powerful prayer):
Comments
Post a Comment