OpenSSH on windows server can't connect with windows permissions - powershell

I followed these instructions to a T:
https://winscp.net/eng/docs/guide_windows_openssh_server
For some reason, I can't login to my server. Says it's connecting and then I get this error:
Authentication log (see session log for details):
Using username "damien".
Authentication failed.
I know that I'm using the proper permissions so what gives? The SSH server is definitely running. This is on a Windows 2012 Server.

Related

Unable to connect to SQL Server using ipaddress or localhost and portno 1433

I have installed Microsoft SQL Server 2019, I am able to connect using hostname and Windows authentication from SSMS, but when it try to connect to it using localhost or the IP address and port 1433 from SSMS or DBeaver, it doesn't connect.
I have verified the service status, port no, server logs, all looks good but still unable to connect. Can somebody please help?
The issue is resolved after enabling server authentication.steps :-
1. In SSMS right click on conection
2. Go to properties-> security
3. Change authentication mode to windows and SQL server from windows authentication.
After making this change , I am able to connect to the sever using ipaddress.

PAM authentication + pgAdmin fails remotely, but locally works

I've been trying to configure postgresql with PAM on a Red hat server so that I can get remote access to the server via pgAdmin and use local (server) authentication with PAM.
I have edited the pg_hba.conf file and changed the appropriate line:
host postgres all 0.0.0.0/0 md5
and added this one:
host pam_testing all 0.0.0.0/0 pam pamservice=postgresql95
Moreover I created database user with the same username as I use to log in with putty (no password, simply create user xxx)
When I try to log in remotely with pgAdmin to postgres database (using md5) with my database user everything works smoothly.
But When I try to connect (also remotely, with pgAdmin) to pam_testing database with my server username (to which I log in via ssh using putty) and give the password I get the following error:
Error connecting to the server: FATAL: PAM authentication failed for
user XXX
BUT! When I log in locally to pam_testing while connected via putty it works! My system user gets logged in and authenticated without any problems. And it only happens for users, which I added to the database using create user.
I'm guessing it must be some kind of authentication issue (with the server maybe? It belongs to company and I don't know what other authentication methods it uses) but I'm not sure. Any ideas?
System: Red hat 6.8,
Postgresql: 9.5
Thanks in advance!
Do systemctl | grep unix_chkpwd and if you see lines like these
unix_chkpwd[13081]: check pass; user unknown
unix_chkpwd[13081]: password check failed for user (<username>)
then you've encountered the same problem I did.
To solve it you need to give postgres user read permissions to /etc/shadow file. You can do this via acl: setfacl -m g:postgres:r /etc/shadow, or by creating some group, giving it this permission and then adding postgres to it. Then do systemctl restart postgresql.service.
The underlying mechanics of authenticating with pam is described in this post. The key moment is the following: unix_chkpwd runs under the uid of the process which wants to authenticate someone, so if it's not root (and /etc/shadow is used which I believe is the common case), it can't do its job.

Can't connect to Google Cloud SQL

I opened a trial account on Google Cloud and I'm having difficulties connection to Cloud SQL.
I made the basic setup, authorizing my IP/32 && adding a new User (appUser).
But I can't open a remote connection to the instance.
mysql -v --host=<ip> --user=appUser --password
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '<ip>' (60)
I'm at work and obviously behind a ton of firewalls and whatnot. Could this be the cause of my problems ?
There is a good change that it is a firewall problem. Error 2003 (from MySQL client manual) means that it can't connect to the server.
Can you try to connect through a computer outside the firewall?

bugzilla can't connect to postgres server

I just installed bugzilla-4.4.1 on version 6.4 of Scientific Linux, and I'm having problems connecting to the database (Pg version 8.4).
When I try to fetch the main page (index.cgi), I get the following message:
Software error:
Can't connect to the database.
Error: could not connect to server: Permission denied
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
Is your database installed and up and running?
Do you have the correct username and password selected in localconfig?
For help, please send mail to the webmaster (root#localhost), giving this error message and the time and date of the error.
Postgres's pg_hba.conf.conf is configured for md5 auth on localhost:
host all all 127.0.0.1/32 md5
and I can connect to the bugs user in the database using psql:
psql -h 127.0.0.1 -U bugs
Running checksetup.pl seems to confirm that the database is set up and configured properly:
... snip ...
Reading ./localconfig...
Checking for DBD-Pg (v2.7.0) ok: found v2.15.1
Checking for PostgreSQL (v8.03.0000) ok: found v08.04.1800
Removing existing compiled templates...
Precompiling templates...done.
Fixing file permissions...
Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.
checksetup.pl complete.
[root#PAHRALBLNX001 bugzilla]#
and the testserver.pl script indicates that the server is set up properly:
[root#PAHRALBLNX001 bugzilla]# ./testserver.pl http://127.0.0.1/
TEST-OK Webserver is running under group id in $webservergroup.
TEST-OK Got padlock picture.
TEST-OK Webserver is executing CGIs via mod_cgi.
TEST-OK Webserver is preventing fetch of http://127.0.0.1/localconfig.
I've also verified that the bugs username and password in localconfig matches the setup in Postgres.
The one thing that seems odd however, is that when I look at localhost with Wireshark, I don't see any attempts to connect to the PostgreSQL server while accessing the bugzilla main page. However, if I connect to the PostgreSQL server using psql, I do see the connection in Wireshark.
Edit
I also discovered that bugzilla wouldn't send email. This turned out to be a selinux problem as pointed out by Daniel Vérité. I changed httpd_can_sendmail and httpd_can_network_connect to true, and now it works.
Based on the error message:
Error: could not connect to server: Permission denied
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
Permission denied when trying to connect to an IP address means it's denied by the local security policy.
The web server must be enabled to connect to databases with this command:
setsebool -P httpd_can_network_connect_db 1
and if it's not sufficient:
setsebool -P httpd_can_network_connect 1
See http://wiki.centos.org/TipsAndTricks/SelinuxBooleans for more

connecting to sql remotely with named instance

I have just install mssql 2008 r2. I am unable to connect to the server remotely.
I have followed the details on this post in regards to openning the firewall and allowing remote connections. Actually for testing purposes i've disabled the firewall.
I'm getting error 26. Which refers to be unable to find the instance name.
I've tried difference variations of the following my local mssql 2008
Servername: remoteIp\instanceName
Login: myUser
Password: myPassword
If my servername correct