$ openssl s_client -showcerts -servername example.com -connect example.com:443 </dev/null | openssl x509 -noout -dates -in -
...
notBefore=Feb 22 18:00:59 2024 GMT
notAfter=Feb 21 18:00:59 2026 GMT
This is where I post snippets of information about Information Technology. It is mostly for my own reference but I hope that others will find it useful and comments are welcome.
$ openssl s_client -showcerts -servername example.com -connect example.com:443 </dev/null | openssl x509 -noout -dates -in -
...
notBefore=Feb 22 18:00:59 2024 GMT
notAfter=Feb 21 18:00:59 2026 GMT
red@mymac ~ % defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
I followed instructions I found here: https://hub.docker.com/_/golang
You can use it like this ...
This is the use case where you are expecting a task to fail during the unit test. There are cases where you would want to test for this. Use your imagination.
Anyways add this to the end of your molecule/*/converge.yml file:
Run this SQL query ...
Copy lines of text between '{}'s
Give this text file contents:
Move the cursor to the '{' on line 12. (:12<return>) then type: mk%y'k then move the cursor to line 7 and type: p and the file should look like this:
Respond with the inventory the hosts you wish to update are in. This will provide the value to the special AWX variable tower_inventory_id.
Example:---update_ati_fqdns:- host1.example.com- host2.example.comansible_connection: 'local'
If you are having trouble getting your AWX deployment to preform authentication with LDAP you might want to make sure that the container that runs the AWX web server can talk to the LDAP server over a encrypted connection. To do this follow these steps:
kubectl -n awx get pods
You are looking for the pod that has the 4 containers. In my case this is pod, awx-demo-8ded6678-gk322.
kubectl -n awx exec -it awx-demo-8ded6678-gk322 -c awx-demo-web -- /bin/bash
echo | openssl s_client -connect ldap.example.com:636
Check the output. Are you getting output? You can check the dates on the certificate like so:
echo | openssl s_client -connect ldap.example.com:636 2> /dev/null | openssl x509 -noout -dates
So You Disabled built-in authentication system on AWX and you're locked out. Do not panic I have done the same and here is how I fixed it. Here is the screen I am talking about:
DO NOT CLICK THAT UNLESS YOU ARE SURE YOU CAN LOG BACK IN! As soon as you click that link you are logged out and will probably not be able to log in ... hence this blog post. :)
I had deployed AWX by installing awx-operator & awx-demo on to a K3s cluster. Well, I clicked on the "Disable ..." link because I thought I needed to do that to get LDAP authentication to work. I was wrong and I was locked out of the AWX UI!
What happens when you click that link is that AWX updates a table, config_settings, so that the rest of the AWX systems know that the builtin authentication is disabled. So what you need to do is update that row in the database. And here is how you do that.
kubectl -n awx get pods
You are looking for the pod that has the 4 containers. In my case this is pod, awx-demo-8ded6678-gk322.
kubectl -n awx exec -it awx-demo-8ded6678-gk322 -c awx-demo-web -- /bin/bash
This will give you a "bash-5.1$ " prompt. Use this prompt to enter the commands below.
cat /etc/tower/conf.d/credentials.py
psql -h awx-demo-postgres-13
I got awx-demo-postgres-13 from step 3 above. Enter the password that was in the credentials.py file.
From the psql prompt, awx=#, execute this SQL:
update conf_setting set value = false where key = 'DISABLE_LOCAL_AUTH'
I forget if I needed to restart anything. But you could try deleting the pod if you still can't login.
I have a K3s cluster and I set up my AWX server by installing awx-operator. I also have an OpenLDAP server. My OpenLDAP server has a signed valid TLS Cert and works fine.
Next I log on to my AWX server as the 'admin' user.
You get the password for this account by executing:
kubectl get secret awx-demo-admin-password -o jsonpath={.data.password} | base64 --decode
I navigate to "Settings > LDAP Default" and filled out the form. Set:
ref.
https://www.fosslinux.com/35730/5-ways-to-check-if-a-port-is-open-on-a-remote-linux-pc.htm
$ nc -zvw10 192.168.0.1 22
$ nmap 192.168.0.2 -p 103
$ telnet [IP or Hostname] [PortNumber]
echo > /dev/tcp/[host]/[port] && echo "Port is open"
echo > /dev/udp/[host]/[port] && echo "Port is open"
netstat -tuplen
netstat -tuplen will output the whole list of the IP addresses. The entries that have “Listen” in the “State” column are the open ports.
In [19]: import logging
In [20]: l = logging.getLogger('django.db.backends')
In [21]: l.setLevel(logging.DEBUG)
In [22]: l.addHandler(logging.StreamHandler())
In [23]: User.objects.all().order_by('-id')[:10]
(0.000) SELECT "auth_user"."id", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."password", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."is_superuser", "auth_user"."last_login", "auth_user"."date_joined" FROM "auth_user" ORDER BY "auth_user"."id" DESC LIMIT 10; args=()
Out[23]: [<User: hamdi>]