invalid username and password snowsql - snowsql

While login to snowflake from command prompt I'm getting the below error
the error:
250001 (08001): Failed to connect to DB:
EGA12345.us-east-1.snowflakecomputing.com:443. Incorrect username or
password was specified. If the error message is unclear, enable
logging using -o log_level=DEBUG and see the log to find out the
cause. Contact support for further help.
I can able to log into web UI by using the same username and password, but not from snowsql
command is snowsql -a EGA12345.us-east-1 -u venu
thanks in advance.
Venu

Check what role you're using via snowsql. The default role would be "defaultrolename", which I doubt exists for your account. I tested this by changing the .snowsql/config file to have a connection where rolename=non-existing-role. Using that connection, I get the error in your original post.

Related

postgreSQL password authentication failed for user

I'm taking a full WebDev course and got really hard stuck on this matter. I've installed postgreSQL 14.2 for Windows 10 and the instructor said that pgAdmin4 would come together, which it didn't, so then i installed pgAdmin4 individually. I've setted everything up and created a testing database, which is called 'test', and also a table, everything through Windows Powershell command lines, following the course instructions. Now, when i try to access this database through PowerShell command psql 'test' and type the requested password for the OS user i get a Fatal Error, which follows:
PS C:\Users\theu_\desktop> psql 'test'
Password for user theu_:
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "theu_"
I've tried my OS username password and the postgreSQL password, none of them works. What am i missing or did wrong?
Thanks in advance
Try accessing postgres by using psql -U postgres in cmd, postgres being the name of the superuser for postgres itself (if you did a basic install) - while windows is probably trying to access postgres with your windows name.
You should also be able to use SQL Shell to access your database without denoting a user.

bcp Login failed using ActiveDirectoryPassword authentication

Followed the description mentioned in below link:
https://learn.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-ver15#G
Goal - Using BCP utility, trying to login to SQL server using Azure Active Directory Username and Password.
Used below command :
bcp tableName out "C:\temp\tabledata.txt" -c -t -S xxxxxxx.database.windows.net -d AzureDB -G -U xxxxxx#xxxxx.com -P xxxxx
Getting below error:
SQLState = FA004, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Failed to authenticate the user 'xxxxxxxx#xxxxxxxxxx.com' in Active Directory (Authentication option is 'ActiveDirectoryPassword').
Error code 0x800401F0; state 10
CoInitialize has not been called.
Any help ?
I guess you don't set your public ip address and active directory to access your azure sql server. And please make sure your username and password is correct.
If you don't configure, you will face this error:
Steps how to configure:
allow your public ip address:
2.allow you to use AAD authentication.

Failed to connect to mLab by mongo

I tried to connect to mLab on my terminal when I followed the instruction on the website
This is the command that I typed
mongo ds151461.mlab.com:51461/simplelogin -u <dbuser> -p <dbpassword>
This is the result I got:
MongoDB shell version v3.4.4
connecting to: mongodb://ds151461.mlab.com:51461/simplelogin
MongoDB server version: 3.2.13
WARNING: shell and server versions do not match
2017-06-12T19:12:35.498-0400 E QUERY [thread1] Error: Authentication failed. :
DB.prototype._authOrThrow#src/mongo/shell/db.js:1459:20
#(auth):6:1
#(auth):1:2
exception: login failed
Btw, when I run the local mongoDB, I use mongod to make it work and mongo does not work
As the error suggests you have an authentication error.
Which is possibly happening because you are using credentials of a user that is not valid for the database "simplelogin".
(You can't use mlab credentials here, I made this mistake, might help someone, so worth a mention.)
If you don't have a user in the database yet. Follow following steps to create a user.
1 - Go to your database page, by clicking on the database from the landing page.
Or use following url, https://mlab.com/databases/simplelogin (you have to be logged in for this to work)
2 - From there click the "Users" tab. Click on the button that says "Add database user", and enter username and password (lets say username - "myuser" and password - "mypassword" for this illustration). Click the "Create" button.
3 - Use those credentials to connect to your database.
mongo ds151461.mlab.com:51461/simplelogin -u myuser -p mypassword
And it should work.
Does this help?

How to change the root password after memsql install?

I've installed MemSQL community edition (single host cluster) and all is working well. I need to allow remote access to the database, but MemSQL installs the user root without a password. If I open up the 3306 port on the firewall, memSQL happily allows anyone to log in as root without a password.
I've tried to change the root user password via
mysqladmin -u root -h 127.0.0.1 password abc123
but I get the error of
mysqladmin: unable to change password; error: 'Unknown system variable 'password''
I also tried to change after connecting as root. all of these fail:
mysql> SET PASSWORD = 'abc123';
ERROR 1193 (HY000): Unknown system variable 'PASSWORD'
mysql> SET PASSWORD = PASSWORD('abc123');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('abc123')' at line 1
mysql> SET PASSWORD = OLD_PASSWORD('abc123');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('abc123')' at line 1
So I'm stuck. The docs for MemSQL are pretty lightweight on this issue as well, and they don't seem to have a community page where I can ask about this. I figure it's something really simple that I'm trying to do, not sure why it's so difficult, and for that matter, I'm not sure why MemSQL defaults to no security at all.
Any ideas?
In the June 2015 release of MemSQL Ops, you can now change the root password with one command using the memsql-update-root-password command. See these links for more information:
http://docs.memsql.com/4.0/ops/cli/MEMSQL-UPDATE-ROOT-PASSWORD/
http://docs.memsql.com/4.0/admin/security/#adding-or-updating-the-root-password
I hope this helps!
In MemSQL to change a password of a user you should use the GRANT command:
grant all on *.* to 'root'#'localhost' identified by 'password' with grant option;
grant all on *.* to 'root'#'%' identified by 'password' with grant option;
Refer to the manual of the GRANT command and to a very detailed manual of configuring the cluster security:
http://docs.memsql.com/latest/ref/GRANT/
http://docs.memsql.com/latest/admin/security/#configuring-password-security
Try
mysql --user=root --password=abc123 --host=127.0.0.1
or
mysql -u root -p abc123 -h 127.0.0.1
Reference: Mysql man page.
You can change the root password with:
GRANT ALL ON *.* TO "root"#"%" IDENTIFIED BY 'password' WITH GRANT OPTION
I observed one strange thing while changing password for root user in mysql as below.
mysqladmin -u root password 'mypassword'
Got error as
mysqladmin: unknown variable 'database=mydatabase'
The reason for this is mydatabase variable has been set in the /etc/my.cnf file. I commented out that line, then everything works fine.
I though of sharing this in this thread.

Cant connect to FTP with newly created account

I am trying to connect to a new user account I created via SSH with the command
useradd -s /bin/false -d /home/username james
I added/edited the password via SSH with the command
passwd james
When trying to connect to my server using this user and pass via FileZilla I get the following error messages.
Response: 331 User James OK. Password required
Command: PASS *****
Response: 530 Login authentication failed
Error: Critical error
Error: Could not connect to server
When I try to login with this user/pass through SFTP I get the following error messages
Status: Connected to domain.com
Error: Connection closed by server with exitcode 1
Error: Could not connect to server
Either way it seems it doesn't allow me to use this newuser anywhere.
My server details
Linux 2.6.18-308.11.1.el5 GNU/Linux
(Red Hat 4.1.2-52)
Centos
Regarding FTP, the FTP server commonly used on Linux systems requires users to have a shell that's listed in the file /etc/shells. For example, this online ftpd man page says that, among other things, "The user must have a standard shell returned by getusershell(3).". The page for getusershell() shows that it reads shells from /etc/shells.
You could probably make FTP work adding /bin/false to /etc/shells. Your Linux system might have a more suitable shell available, like /usr/sbin/nologin.
Regarding SFTP, the ssh server normally provides SFTP service by by invoking a program called sftp-server. If you examine the server's sshd_config file, you'll probably find a line like this:
Subsystem sftp /usr/lib/openssh/sftp-server
sshd runs the subsystem program as a shell command, using the user's shell. If you set the user's shell to /bin/false, then sshd ends up running the command:
/bin/false -c /usr/lib/openssh/sftp-server
/bin/false ignores its command-line arguments and exits with code 1, so the SFTP client's session drops immediately after it starts.
sshd has an internal SFTP server component that can be used instead of the external program. The usual way of limiting SSH access to SFTP for some users is to set up a Match group within sshd_config, forcing the internal-sftp command for certain classes of users. Here are a couple examples of that:
http://en.wikibooks.org/wiki/OpenSSH/Cookbook/SFTP#SFTP-only_Accounts
https://serverfault.com/questions/354615/allow-sftp-but-disallow-ssh
Dont use "-s /bin/false". Use "-s /sbin/nologin" instead and it should be fine.
Make sure your account password hasn't expired. Mine did, and Filezilla exited with error code 1.
After logging onto the server and updating the account password (prompted immediately after connecting), I am now able to connect with SFTP & Filezilla.
Probably is a password related issue, check account
chage -l <user>
account must not be expired.
FTP doesn't allow /usr/sbin/nologin user
Response: 220 Welcome to the Scent Library's File Service.
Command: USER ftpuser
Response: 331 Please specify the password.
Command: PASS ******
Response: 530 Login incorrect.
filezilla 530 error - but password is correct
vsftpd: 530 Login incorrect
530 Login or password incorrect!
How can I connect via FTP using FileZilla? I get a 530 error.
Response: 220 Welcome to Test FTP service.
Command: USER ftpuser
Response: 331 Please specify the password.
Command: PASS ******
Response: 530 Login incorrect.
Error: Critical error
Error: Could not connect to server
Change user's shell
usermod -s /usr/sbin/nologin username
Then edit "/etc/shells" file and add this line
/usr/sbin/nologin
In order to connect to the server using ftp, you also need to run a ftp server / service or daemon.
An example of such ftp server is "vsftpd"
After installing it, you will also need to configure it and allow anonymous ftp access or ftp access to existing users
You will find the configuration file in the path "/etc/vsftpd/vsftpd.conf"
The below link might be useful for you --
https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-on-centos-6--2

Resources