How to create a password WITH SPACES via Command Prompt - passwords

I found the syntax to change a user password through command prompt. I am using:
net user username password
I have sucessfully changed the password to a regular password. I can not figure out how to change it to a pass-sentence. How would I write the syntax for a password with spaces in it?
For instance, please explain how I would write "My new password." in cmd...because this doesnt work:
net user testuser2 My new password.
I am sure that it is case sensative, no? If its case sensative for the password, why wont it recognise the sapces as part of the password?
Thank you for your time.

Try surrounding the password with quotation marks, such as:
net user username "My new password"

Typically you can put the phrase in double quotes ex "My new password" is you have spaces in you command line.

Related

How do I fix postgres'> when I try to create a new role in my aws rds

when I try to run the command create role new_user with passowed 'passowrd' login; it just gives me postgres'> on a new line. I am logged in as a superuser in aws postgres rds. what does this mean and how do I fix this?
That means that your typing on the command line is as sloppy as your typing in Stackoverflow, and you didn't close the single quotes properly. Now psql is waiting for you to continue the string input.
Reset the query buffer by hitting Ctrl+C and start again, taking care that you balance the quotes.
Perhaps the password contains a single quote, which you would have to escape by doubling it.
Let me remark that setting a password like this is unsafe: the password is visible on your screen, will end up in your history file, is sent over the line in clear text and may end up in the PostgreSQL log. Use \password to set the password, then you also don't have to worry about escaping single quotes.

John The Ripper 'No password hashes loaded'(see FAQ)

I am trying to learn John. I've been through the FAQ and this tutorial, but am stuck.
I have made a RAR4 password hash. It's super simple. The password is 'test'. I now want to use a tool to crack it.
I've saved it to a file "test.txt".It has:
Red dead redemption.rar:$RAR3$*1*de613099dc859cfd*00000000*16*0*1*b52125c28c4fc60a1c00f313d0fb68ca*33:1::Red dead redemption.torrent
When running the following command, I get 'No password hashes loaded'
What should I do to get this working please?
Command: john.exe test.txt
$$ in your hash specify that they are encrypted with yescrypt, Hence you need to specify format to the john
john.exe --format=crypt test.txt
This should work

Special character (!, exclamation mark) in DB2 user password gives error when starting i2 Analyze or connecting from DB2 command console

The following error occurs when starting i2 Analyze with example deployment
(some parts of error messages are in Finnish because of the Windows localization settings, sorry about that)
setup -t startLiberty
java.sql.SQLInvalidAuthorizationSpecException: [jcc][t4][2013][11249][4.17.29] On ilmennyt yhteyden käyttöoikeusvirhe. Syy: Käyttäjätunnus tai tunnussana ei kelpaa. ERRORCODE=-4214, SQLSTATE=28000 DSRA0010E: SQL State = 28000, Error Code = -4 214
I believe the error is more closely related to DB2(10.5 FP7) & Windows(W12R2) than i2 Analyze itself because when connecting from DB2 command console (db2cmd) and giving both username and password (with !) within a single line:
connect to WRITESTORE user db2admin using <SomePasswordWith!>
The error shown in console is as follows:
SQL0104N Järjestelmä on löytänyt merkkijonoa "<tunnus>" seuraavan
tunnistamattoman sanakkeen "!". Odotettuja sanakkeita ovat esimerkiksi
seuraavat: "NEW". SQLSTATE=42601
Anyhow, if password (with character !) is given only when prompted eg:
connect to WRITESTORE user db2admin
and giving password when asked, user is logged in without an error.
Also when connecting to DB2 with IBM DataStudio gives no error.
So, using passwords without special characters is a workaround for the issue.
http://www-01.ibm.com/support/docview.wss?uid=swg21303153
Username/password with special characters need to be quoted when using them through CLP within db2prompt
Lainausmerkkeihin :)
connect to WRITESTORE user db2admin using '<SomePasswordWith!>'

Hiding password for SQL user in Powershell

I am using the following script to pass SQL credentials at the command line , but I need user to enter the password for the SQL user not the Windows Credentials in it and to make sure that the password is not revealed in clear text when inserted in the prompt. Here is my script:
Param(
[Parameter(Mandatory=$True)]
[ValidateNotNullOrEmpty()]
[string]$dbusername="",
[Parameter(Mandatory=$True)]
[ValidateNotNullOrEmpty()]
[string]$password="",
[Parameter(Mandatory=$True)]
[ValidateNotNullOrEmpty()]
[string]$Machine=""
)
This works fine, but I would like to make sure that the password is hidden when user is inserting it in the prompt.
I have used this line to do it
Read-Host -Prompt "Enter your password" -AsSecureString
But this cannot be inserted in the Param block, and I I insert it afterwards it has no effect.
How can I mask the password when is inserted by the user at the prompt?
For PS V3,casting to securestring ie: [securestring]$password="" should be sufficient.
You will certainly have to convert back this securestring to plain text before using it with your app. This can be done with:
$Ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($password)
$clearpassword = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr)
[System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($Ptr)

Masked user input via VB assembly called in Powershell

I have a powershell script that would like user to enter password. It calls a function to get a pop up box for the user input. Now it is in plaintext. I'd like it to be hidden/masked
This is the function created :---
function Read-InputBoxDialog([string]$Message, [string]$WindowTitle, [string]$DefaultText)
{
Add-Type -AssemblyName Microsoft.VisualBasic
return [Microsoft.VisualBasic.Interaction]::InputBox($Message, $WindowTitle, $DefaultText)
}
This is the way i called the function from powershell : ---
$SQLPassword = Read-InputBoxDialog -Message "Please enter SQL password used to connect to Database Server" -WindowTitle "Sql Server Authentication" -DefaultText ""
How do I ask mask the password as **** ?
Instead of an input box, Powershell has got its own implementation Get-Credential. It stores credentials as secure strings, so getting a plaintext password requires some tweaking. Like so,
$cred = Get-Credential -Message "Enter Sql password"
$cred.GetNetworkCredential().username # Show the username
$cred.GetNetworkCredential().password # Show the password