Simplest command to expand certificate - lets-encrypt

I am not using certbot, only letsencrypt command, and this other question/answer is so complex to something so simple: use --expand in a letsencrypt command.
The question here: how to use --expand, what the correct syntax? there are no example in the guide.
Supposing that domain1 is the main domain, and domain2 and domain3 was created with the initial command, letsencrypt --apache -d domanin1 -d www.domanin1 -d wiki.domanin1 -d domanin2 -d www.domanin2 -d domanin3
... What the correct syntax to add a domain4? 1, 2 ... or 5?
letsencrypt --apache --expand domanin4
letsencrypt --apache --expand -d domanin4
letsencrypt --expand -d domanin4
letsencrypt --apache --expand -d domanin1 -d domanin4
letsencrypt --apache --expand -d domanin1 -d www.domanin1 -d wiki.domanin1 -d domanin2 -d www.domanin2 -d domanin3 -d domain4
PS: need to repeat all domains and subdomains in the expansion?

This question will have no answer... Because letsencrypt is no longer developed (!), if you using: you using something junk.
certbot is the more recent version of letsencrypt (there was a change of name)
(see community.letsencrypt.org/24474)
So, the remain question is "how to do an --expand equivalent with certbot?" Because:
--expand is a certbot option that we haven't implemented/don't support. (...) However, we have a --hooks option which has similar functionality.
(see letsencrypt-cli/issues)
So, as the question request, simplest certbot --hooks command to expand certificate?
PS: somebody say that it is impossible!

Related

Mac OS security command works different in different versions

I have a command I try to run on Version 12.5:
/usr/bin/security add-trusted-cert -r trustAsRoot -k /Library/Keychains/System.keychain -p ssl -p basic -d './blabla.blabla...'
And it works.
Then I try the same command in version 12.3.1
But I get the following: SecTrustSettingsSetTrustSettings: One or more parameters passed to a function were not valid.
But, in this version, If was to run /usr/bin/security add-trusted-cert -r trustRoot -k /Library/Keychains/System.keychain -p ssl -p basic -d './blabla.blabla...' it works.
Could anyone please explain? I'd like to get a working command for all versions.
By the way, If I run: /usr/bin/security add-trusted-cert -r trustRoot -k /Library/Keychains/System.keychain -p ssl -p basic -d './blabla.blabla...' on version 12.5 it fails for same reason.

Let's Encrypt SSL in Bash

I try to search it on the internet but found nothing. I want to install Let's Encrypt SSL cert via bash script. I will run below command in the bash script:
certbot --nginx -d $sitename -d www.$sitename
and it will prompt below questions,
enter e-mail address (used for......):
Please read terms of....... (A)gree/(C)ancel:
(Y)es/(N)o:
How can I automate above prompts in bash script?
sitename="example.com"
certbot --nginx -d "$sitename" -d "www.$sitename" -m foo#example.com --agree-tos -n
See: certbot --help

How to download file from server (sso and https)

It is possible to download a file from a server that use HTTPS + SSO (Single Sign ON) by means command line (of course using linux)?
The Single Sign On system run with shibbolet process
SOLVED!!
wget --save-cookies sso.cookie --keep-session-cookies --header="Referer: https://serverCheckPoint/" 'https://serverCheckPoint/Shibboleth.sso/Login?target=https://ServerCheckPoint/path_Of_The_File_To_Read'
curl -b sso.cookie -c 2sso.cookie -L -k -f -s -S https://IDP_SERVER/PATH_of_loginPAge --data "USER=yourUser&password=YOURPASSWORD" -o localfile.html
wget -v --load-cookies 2sso.cookie --save-cookies auth2.cookie --keep-session-cookies https://CheckPointServer/Path_of_data/DATA_to_DOWNLOAD
the file sso.cookie, 2sso.cookie, auth.cookie are used in order to store the session and the SAML token.
In case there are problem with certificates you should to disable the check for the TLS certificates

Starting amqp-consume on Debian 8

I used to consume messages from amqp-consume with this command below at debian 7, but I installed debian 8 I think the amqp-tools is different and it does not recognize my command.
I noticed some changes. My web interface change the port from 55672 to 15672.
amqp-consume -d -q queue.udrive.admin.uiscsi -s 10.0.1.251 -p 5672 -e "directExchangeUdrive" --vhost "/" -r "" --username=guest --password=guest /bin/bash remoteManageUiSCSI.sh
error: both --server and --url options specify server host
I think the command expects it:
amqp-consume
consuming command not specified
Usage: amqp-consume [-dxA?] [-u|--url=amqp://...] [-s|--server=hostname] [--port=port] [--vhost=vhost] [--username=username] [--password=password] [--ssl] [--cacert=cacert.pem] [--key=key.pem] [--cert=cert.pem] [-q|--queue=queue] [-e|--exchange=exchange] [-r|--routing-key=routing key] [-d|--declare] [-x|--exclusive] [-A|--no-ack] [-c|--count=limit] [-p|--prefetch-count=limit] [-?|--help] [--usage] [OPTIONS]... <command> <args>
I tried all kinds of things on amqp:// and it dodn't work.
I got the answer at other site https://qpid.apache.org/releases/qpid-0.30/programming/book/QpidJNDI.html but I still wonder to know why this answer was not at the "man amqp-consume" or rabbitmq web site....
The command works for me is:
amqp-consume -d -u amqp://test:test#ustorageprod/%2f -q queue.udrive.admin.uiscsi -e "directExchangeUdrive" -r "" /bin/bash remoteManageUiSCSI.sh
amqp-publish -u amqp://test:test#ustorageprod/%2f -r "queue.udrive.ustorage" -e "directExchangeUdrive" -b "$msg"

Ldap search with negative parameter

I'm trying to do a search on my LDAP base like that:
ldapsearch -x -h localhost -p 389 -D uid=xxxadmin,ou=administrators,ou=topologymanagement,o=netscaperoot -v -w 12345 -b "ou=Usuarios,ou=Alunos,ou=XXXX,o=xxXXXxx" -f (!(objectClass=ntUser)) 1.1
Basically I want to list all the entries without the objectClass ntUser and add the objectClass to them.
I'm getting this as an answer:
-bash: !: event not found
From http://www.openldap.org/lists/openldap-software/200104/msg00196.html
This message comes from the shell (bash). It states that the command
`!' didn't find the event you unintentionally asked for. This happens
because the double quotes in bash do not prevent some command
invocation. Use single quotes instead:
Your search should be like this:
ldapsearch -x -h localhost -p 389 -D 'uid=xxxadmin,ou=administrators,ou=topologymanagement,o=netscaperoot' -v -w 12345 -b 'ou=Usuarios,ou=Alunos,ou=XXXX,o=xxXXXxx' -f '(!(objectClass=ntUser))' 1.1
Your search should work. But, for bash, you will need to quote the parameters.
Something like:
ldapsearch -x -h localhost -p 389 -D uid=xxxadmin,ou=administrators,ou=topologymanagement,o=netscaperoot -v -w 12345 -b "ou=Usuarios,ou=Alunos,ou=XXXX,o=xxXXXxx" -f "(!(objectClass=ntUser))" 1.1
Tested both openLDAP
#(#) $OpenLDAP: ldapsearch (Ubuntu) (Mar 17 2014 21:19:27) $buildd#aatxe:/build/buildd/openldap-2.4.31/debian/build/clients/tools
(LDAP library: OpenLDAP 20431)
ldapsearch -x -h localhost -p 389 -D "cn=admin" -W -b "dc=example,dc=com" -s sub -a always -z 1000 "(!(objectClass=inetOrgPerson))" "objectClass"
and OpenDJ
ldapsearch --version
OpenDJ 2.7.0-20140727
Build 20140727000040Z
ldapsearch -h localhost -p 389 -D "cn=admin" -b "dc=example,dc=com" -s sub -a always -z 1000 "(!(objectClass=inetOrgPerson))" "objectClass"
-jim
Its happening because bash thinks ! as a special character
"!" Start a history substitution, except when followed by a space, tab, the end of the line, ‘=’ or ‘(’
So finally, you should be able to solve your problem by putting single quotes around the term as follow:
ldapsearch -x -h localhost -p 389 -D uid=xxxadmin,ou=administrators,ou=topologymanagement,o=netscaperoot -v -w 12345 -b "ou=Usuarios,ou=Alunos,ou=XXXX,o=xxXXXxx" -f '(!(objectClass=ntUser))' 1.1
Please refer following question on stackoverflow.
Which characters need to be escaped in Bash? How do we know it?

Resources