How to delete an account created through ./acme-account-creation-tool - ibm-secrets-manager

I have created an account through below command -
./acme-account-creation-tool -e email -o my-letsencrypt -d letsencrypt-prod
How can I delete the account created by above command?

Related

Role not created after using psql -c "create user...."

I'm trying to create a script that creates readonly users but while trying to create a user my database doesn't update with the new user. The terminal returns a "CREATE ROLE" and no errors.
I've tried setting -U -h -p and calling the current_user() which shows that I'm the superuser making the call.
psql \
-X \
-U $PGUSERNAME
-h $DBHOST \
-p $PORT \
-c "create user readonly with password 'welcome';" \
-d $DATABASENAME \
I'm connected to my postgres via goland and when I run the shell file which runs that psql the terminal returns a "CREATE ROLE" but the postgres isn't reflecting any new roles and when I run the query in the PostgresSQL console to find my readonly user 0 rows are found. I expected the shell script to create a user and update my local database.
As Laurenz Albe mentioned in the comment removing the \ at the end resolved this issue.

Send mails to multiple users with looping using mailx and output from another file

Project scope: Locking few users and sending them email that has to be automated.
Issue: the mailx part isn't working as I need help on how to input the options for mailx.
DB server: AIX 7.x
I have a file that has the below:
alter user x1 account lock;
alter user x2 account lock;
I have to use the x1,x2.. and send these user individual email using mailx.
Part of my script is:
for i in $(cat Test_lock_users.log)
do
print mailx -c manager#abc.com -s "WARNING - $ORACLE_SID User account Locked" "manager#xyz.com $i#xyz.com"
done
Korn shell script as stated above in #2. This is on AIX 7.x server
I got the output as given below and no email sent to the address.
mailx -c manager#abc.com -s WARNING - $ORACLE_SID User account Locked manager#xyz.com x1#xyz.com
mailx -c manager#abc.com -s WARNING - $ORACLE_SID User account Locked manager#xyz.com x2#xyz.com
No error message either. Its just gave the output and how to execute/run the mailx with x1, x2 inputs?

can't create IAM access key via bash

I'm trying to rotate AWS IAM access keys via bash script.
I am able to deactivate and delete access keys that are there. But after the last key is deleted and even after a 30 second sleep command, I still get this error trying to create the new key:
An error occurred (LimitExceeded) when calling the CreateAccessKey operation: Cannot exceed quota for AccessKeysPerUser: 2
This is my code:
echo "Deleting AWS user access key: $user_access_key1"
aws iam delete-access-key --access-key-id "$user_access_key1" --user-name "$aws_user_name" --profile "$aws_key"
sleep 2
# Check if key still exists
aws iam list-access-keys --user-name "$aws_user_name" --profile "$aws_key" --output text --query 'AccessKeyMetadata[*].[AccessKeyId,Status]' | sed -e '1d')
sleep 30
#Create new keys
new_keys=( $(aws iam create-access-key --user-name "$user_name" --profile="$aws_env" | jq -r '.AccessKey[] | (.SecretAccessKey, .AccessKeyId)') )
I'm able to verify that the previous key is gone after the script deletes it. So why am I not able to create a new key after deleting the last one?

How to get SFTP login alert (email or SMS) on ubuntu?

I want to get Email or/and SMS alert whenever someone logs into my server. I have successfully done this for SSH login by editing .bashrc file.
But this method doesn't work for SFTP login.
I know I can do this by extracting information from log files, but i want a more efficient way (Since users can delete from log file).
I have also tried this, but it doesn't work.(I'm using ubuntu 12.04).
Basically, I want to execute a curl command (SMS API) on successful login.
Please help, thank you.
First, make sure you have the sendmail package (sudo apt-get install sendmail).
You can create or edit the file /etc/ssh/sshrc and give it the following code to achieve this:
ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
logger -t ssh-wrapper $USER login from $ip echo "User $USER logged in from $ip" | sendemail -q -u "Email Title" -f "Sender <from#server.com>" -t "Your Name <you#email.com>" -s smtp.server.com &
Fill the appropriate variables (sender and recipient names and addresses) into this code.

Postgres createuser.exe silent execution from batch script

I am finding myself with the issue of needing to execute the postgres createuser.exe from a batch script and cannot get it to stop prompting me with the following:
Enter name of role to add:
my batch script looks like this:
echo calling createuser!
createuser username %super_user% -s -U Super_Postgres s -q
Where %super_user% is a command line argument. Any help would be greatly appreciated, this is the documentation that I am referring too: postgres
"username" should go at the end, after the options. You have it as the first parameter.
from the documentation http://www.postgresql.org/docs/8.4/static/app-createuser.html
The following is from the documentation listed above
To create the same user joe using the server on host eden, port 5000, avoiding the prompts and taking a look at the underlying command:
$ createuser -h eden -p 5000 -S -D -R -e joe
CREATE ROLE joe NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
To create the user joe as a superuser, and assign a password immediately:
$ createuser -P -s -e joe
Enter password for new role: xyzzy
Enter it again: xyzzy
CREATE ROLE joe PASSWORD 'md5b5f5ba1a423792b526f799ae4eb3d59e' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;

Resources