Is it posible to setup freeIPA client to use passwordless authentication with ssh keys saved on freeIPA Server? - ipa

This is my envirenment:
1- Server with freeIPA Server installed and configured on it.
2- freeIPA Client enrolled to freeIPA Server.
On freeIPA Server there is many users added with sshkey saved on her profile.
I can login on the client with freeIPA usersĀ“s credentials.
I need to configure de client so when i can login using ssk keys.
I mean even of type a password when i log in to client it authenticate with ssh keys with the ssk key saved on freeIPA server.

Related

How to create local user in Linux by LDAP Authentication

I have setup my LDAP server with user details. I have setup my Ubuntu laptop to authenticate users from LDAP. The problem is, every time user tries to log in, Ubuntu tries to reach LDAP servers to authenticate. So when network connection is out, it shows authentication failed. What I want is when user logs in first time, Ubuntu authenticates from LDAP, and creates a local user profile, and stores credential somewhere on local. So when network connection is not available, it authenticates against last used credentials. And when system connects back to internet, it authenticates against LDAP.
Please help me with this. Let me know if any clarifications are required.
I have created LDAP Server, and my ubuntu system is already authenticating users against LDAP. I want to store the LDAP credentials to a local user once the user logs in for the first time, so that these credentials can be used for authentication when network connection unavailable.
If you are using SSSD as the LDAP client, enable its built-in credential caching. Take a look at options cache_credentials (for auth) and cache_first (for account information) in the sssd.conf(5) manual page.
If you are using nslcd as the LDAP client, install pam_ccreds for authentication caching and nscd for account information caching.

Why does PAM authentication stop requiring 2FA on OpenVPN server after reboot?

I'm running OpenVPN on a Centos 8 server and have it configured to use PAM authentication for users stored in an IPA server. The users are configured to require 2FA. Everything has been working as expected for several months. But recently our domain cert expired. After inserting the new cert into IPA, PAM authentication stopped working on the OpenVPN server.
Nothing in the logs pointed to anything conclusive so I assumed the IPA client running on the OpenVPN server may not be recognizing the new domain certs on the IPA server. So I uninstalled the IPA client on the OpenVPN server and then reinstalled it. Next I restarted the OpenVPN service, reconfigured sssd.conf and restarted sssd. I was now able to successfully authenticate as expected using a password + OTP token when initiating an OpenVPN connection.
But after rebooting the OpenVPN server, the PAM authentication is no longer requiring the 2FA token -- i.e. I can only initiate an OpenVPN connection with a password that does not include OTP token even though the user is configured to require 2FA. I repeated the same uninstall/reinstall steps and again password + 2FA token authentication worked as expected. But like before after reboot, the 2FA token authentication did not work.
After initially reinstalling the IPA ClientThe sssd log for sss_pam_preauth shows:
[pam] [pam_eval_prompting_config] (0x4000): Authentication types for
user [test55#ipa.mydomain.biz] and service [su]: password
two-factor
But after rebooting the sssd log for sss_pam_preauth shows:
[pam] [pam_eval_prompting_config] (0x4000): Authentication types for
user [test55#ipa.mydomain.biz] and service [su]: password
The sssd and pam config files are the same before and after reboot.
I'm at a loss to understand this behavior.
In my haste to repair the OpenVPN server I overlooked the sssd cache. The account I was using for testing at one time was not configured for 2FA.
It appears after reinstalling the IPA Client, authentication looked to the IPA server for sss_pam_preauth where the user is configured for 2FA. But after reboot sss_pam_preauth looked to the sssd cache where the user was not configured for 2FA.
So following the reboot I cleared the user from the sssd cache using the command sss_cache -u user1. With my next test, sss_pam_preauth could no longer find the user in the sssd cache and therefore looked to the IPA server which responded with a requirement for password + 2FA token as expected. I then rebooted the OpenVPN server again and sss_pam_preauth looked to the sssd cache where the user is now configured for 2FA.
The OpenVPN server is now working as expected.

Protecting ftpclient login credentials

My Java app for Windows requires uploading results to a server using an ftp client. Currently, I have the port, sever URL, username and password in an ini file that the app installer places on the users computer. I'm concerned that a user can easily open the ini file and see these credentials and thus be able to log in to my account on the server. I'm considering encryption of the username & password. Or, just ask the user to provide his/her own credentials, perhaps using Google or other free outgoing service? Are there better ways of handling this?
With SFTP, a connection can be authenticated using a couple different techniques one of them involves using Public / Private Key Pair.
With key-based authentication, you will need to generate a SSH private key and public key beforehand. If you want to connect to a partner's SFTP server, you would then send your SSH public key to them so they can load onto their server and associate with your account. Then, once you've connected to their SFTP server, your client software will transmit your public key to the server for authentication. If the keys match, along with any username/password supplied, the authentication will succeed.
Finally got back to this issue, and here's what I've learned.
First, I've decided to provide FTP access on my hosting server with a "home" directory so the user can't access site data other than his own. I will provide the username and password to the user. Second, the username will be stored in the Windows app database. Third, neither the password or a SaltHash of that password will be stored in the database. Thus the user must type in the password on each FTP upload.
The reason for not using SaltHash because is it's pointless. I.e., if I did go to the trouble of creating and storing a SaltHash, the user would still have to type in a password. That entered password could be salt hashed and compared with the stored SaltHash to be sure it's valid but that's no better than getting an acceptance or rejection from the server.
Or, what am I missing?

TLS with username/password with NodeJS

Is it possible to send username/password to a TLS server in NodeJS?
I would like to create a custom VPN-sort of server with NodeJS.
I've tried other TLS VPN services where I can login to a TLS session with username/password - but I don't know if it's default TLS?
I know how to use client certificate authentication, but that is not what I want, as I want to be able to authenticate users via username/password from my database, so I dynamicaly can add/edit users etc.
Not sure if its PEAP or EAP I'm thinking of or...
TLS by itself has no concept authentication with username and password. If you need this you need to implement this on top of TLS, for example with HTTP over TLS (i.e. HTTPS).

Web authentication using desktop ldap

Problem: I want users from my corporate client to authenticate with my web server by using their local LDAP credentials. Users have a local desktop client that can authenticate with the local LDAP server. My server and the LDAP server do not talk to each other.
I know it is possible to authenticate on a web server using LDAP if the web server relays the LDAP request to a LDAP server. (User/desktop client connects to web server, sends credentials and web server interacts with LDAP server for authentication)
But is there a way for a desktop client to authenticate with a local LDAP server and then connect to a web server sending a token that would grant access to the web server? (user auths with ldap, sends ldap response to webserver)
I am not talking Oauth, which requires both servers to talk. In this case, the LDAP server is isolated from outside contact.
The big problem here is that you should never trust the client, even if you have written it yourself. Something like public/private authentication would (probably) not work as well, since the problem is not the encryption, but making sure the message came as "OK" from the LDAP server. A rogue client could fake the OK and sign it anyway.
If I understand your problem correctly, you're looking for a way to make your desktop client talk to your web application using the user's domain credentials.
This should be easy to do using something like ADFS. If you run ADFS inside your clients Active Directory domain, your desktop client can get a token from it using Kerberos. It can then use this token to authenticate with your web application.
You will need to configure your web application to trust tokens issued by the ADFS instance in your clients domain.
ADFS may work, but it is unnecessary. You should look into using SPNEGO as it does not require a ADFS infrastructure.

Resources