Restoring Lost User Account » History » Version 5
Version 4 (Luke Murphey, 04/05/2010 05:47 PM) → Version 5/6 (Luke Murphey, 09/30/2010 01:04 AM)
h1. Restoring a User Account From the Command-Line
The command-line interface (CLI) provides a number of mechanisms for managing NSIA if you cannot access the web-interface. To access the CLI, *stop NSIA* stop all instances of NSIA and run the following command from a shell within the bin directory: shell:
<pre>
java -jar nsia.jar
</pre>
The interactive CLI will appear. Type help to see all commands. To restore access, use one of the following CLI commands:
* User.SetPassword
* User.Unlock
* User.Enable
* User.Add
For example, if you need to change a user's password do the following steps:
First, start NSIA from the command-line
<pre>
ThreatFactor NSIA 0.9.9 (http://ThreatFactor.com)
Web server running on: http://127.0.0.1:8080
Interactive console, type help for list of commands
>
</pre>
Next, run "User.List" to list the users:
<pre>
> User.List
Login Name Full Name User ID Status Is Unrestricted
------------------------------------------------------------------------
Luke Luke 1 Active yes
John John 2 Active yes
Matthew Matthew 3 Active no
Mark Mark 4 Active no
</pre>
We are going to use the "User.setPassword" function to reset the password. Run the command with no arguments to see the necessary arguments:
<pre>
> User.setPassword
Error: too few arguments provided, syntax of the command is "User.SetPassword <username> <password>"
</pre>
Now run the command to set the password (you don't have to provide the password if you want it to prompt for it):
<pre>
> User.setPassword Mark
Enter the user's password:
Enter the user's password again:
Password successfully changed
>
</pre>
Now shutdown NSIA and restart it using the Windows Service, Unix daemon script or however you usually run it:
<pre>
> exit
System is shutting down...Done
</pre>
<pre>
</pre>
The command-line interface (CLI) provides a number of mechanisms for managing NSIA if you cannot access the web-interface. To access the CLI, *stop NSIA* stop all instances of NSIA and run the following command from a shell within the bin directory: shell:
<pre>
java -jar nsia.jar
</pre>
The interactive CLI will appear. Type help to see all commands. To restore access, use one of the following CLI commands:
* User.SetPassword
* User.Unlock
* User.Enable
* User.Add
For example, if you need to change a user's password do the following steps:
First, start NSIA from the command-line
<pre>
ThreatFactor NSIA 0.9.9 (http://ThreatFactor.com)
Web server running on: http://127.0.0.1:8080
Interactive console, type help for list of commands
>
</pre>
Next, run "User.List" to list the users:
<pre>
> User.List
Login Name Full Name User ID Status Is Unrestricted
------------------------------------------------------------------------
Luke Luke 1 Active yes
John John 2 Active yes
Matthew Matthew 3 Active no
Mark Mark 4 Active no
</pre>
We are going to use the "User.setPassword" function to reset the password. Run the command with no arguments to see the necessary arguments:
<pre>
> User.setPassword
Error: too few arguments provided, syntax of the command is "User.SetPassword <username> <password>"
</pre>
Now run the command to set the password (you don't have to provide the password if you want it to prompt for it):
<pre>
> User.setPassword Mark
Enter the user's password:
Enter the user's password again:
Password successfully changed
>
</pre>
Now shutdown NSIA and restart it using the Windows Service, Unix daemon script or however you usually run it:
<pre>
> exit
System is shutting down...Done
</pre>
<pre>
</pre>