how to login in to psql with your admin details - sql

hi am following the following tutorial
https://www.youtube.com/watch?v=qw--VYLpxG4&t=2224s
and when i add psql into my path and then type it into the terminal it asks for my administrator datails of which i give then it shows this
psql: error: FATAL: password authentication failed for user "aarushsharma"
how do i find out the password for aarushsharma?

try to change METHOD in pg_hba.conf file from md5 to trust, restart postgresql server and change your user password
ALTER USER aarushsharma WITH PASSWORD 'your_password';
and set METHOD to md5 again

Related

FATAL: password authentication failed for user "username" in PostgreSQL

I'm new to PostgreSQL. I just installed the Postgres.app on my Mac and wanted to use the psql command in the terminal. However, when I type psql in the terminal, I'm asked to input the password. I was never asked to set a password during installation so I'm confused what the password is. I've looked at other similar questions but none of them worked for my case.
$ psql
$ Password for user kaili:
$ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed:
FATAL: password authentication failed for user "kaili"
Could anyone give me some hints on how to access the database as the user kaili? Thank you!

Cannot connect to aws rds Postgresql using master password and username but pgAdmin works

I Cannot connect to AWS rds Postgresql using master password and username but pgAdmin connection with the certificate works perfectly.
My website, when it tries to connect to the database, says:
net::ERR_CONNECTION_TIMED_OUT
I ssh into my ec2 instance of the Elastic Beanstalk and it gives me the following error when I am trying to connect to the rds:
psql: error: FATAL: PAM authentication failed for user "user"
FATAL: pg_hba.conf rejects connection for host "111.11.1.11", user "user", database "database", SSL off
The command I use to connect is this:
psql --host=rds_endpoint --port=5432 --username=user --password --dbname=database
I changed the master password and still, it does not work.
Again, If I use pgAdming with ssl certificate and that token that it generates, the connection is successful and I have full access to the database.
Also, the command
nc -zv rds_endpoint 5432
gives the successfull result:
Ncat: Connected to 111.11.11.11:5432.
The master username is and password does not contain any special character.
Master username: user
I have had this issue when the password contained special characters. I need to escape them in the connection URL used in psql
Percent-encoding may be used to include symbols with special meaning in any of the URI parts, e.g., replace = with %3D.
https://www.postgresql.org/docs/11/libpq-connect.html#id-1.7.3.8.3.6

Tectia SSH Logon via CMD with password as argument

hello I'm trying out Tectia 6.4 via cmd but I'm having trouble login in with password as argument. I always get the error "too many argument"
I tried
sftpg3.exe host password
sftpg3.exe host --password=password
sftpg3.exe host -p password
If i just enter host-name i get the prompt for the password in order to login. there no way to use password as argument in order to log in via cmd? I look into help and they have option for password but it does not seems to be working for me
Thanks
sftp3.exe --password=yourpassword username#host
Make sure your options are first and you are including your username#host in the command also.
optional -B file.txt where file.txt includes your FTP command to execute after connecting.
NOTE: Having your password in cleartext is considered a security risk.

beeline LDAP authentication with encrypted password file

I am using Beeline CLI to connect HiveServer2. I am using following command to connect:
beeline -u jdbc:hive2://myhost.abc.com:10000/default -n myuser -w pass_sa -e "show tables;"
Connection is successful and I am able to access the Hive database but here my password is not encrypted here I am trying to use encrypted password using password file.
I am going through with several link but having confusion with LDAP authentication and Encrypted password authentication and looking for help on this.
Since you have mentioned LDAP, I assume that you are using Kerberos and "myuser" is Active Directory or Kerberos realm account. You have to authenticate your user with "kinit" and then run beeline without user and password. Beeline should not ask for credentials.
Try to run those steps:
su - myuser
kinit (and type the "myuser" password)
beeline -u "jdbc:hive2://myhost.abc.com:10000/default" -e "show tables;"

plink ssh as root, access denied

I'm trying to connect to a server via plink. However, I'm getting the following error:
C:\>plink -ssh -pw password root#server-name
Using username "root".
Access denied
My sshd_config file contains PermitRootLogin yes, even though that's the default value, just to be sure. Is there some other configuration I need to set to allow this type of connection?
Please post or check contents of the log probably found at /var/log/auth.log.
Another question would be if you have a password added for your root account?
Otherwise you can try and set this using sudo passwd root.
My password contained special characters (!##$%^). I needed to add double-quotes around them to get it to not complain. Silly me!