Tuesday, October 19, 2021

Linux: SSH:Password for Few Users

https://serverfault.com/questions/285800/how-to-disable-ssh-login-with-password-for-some-users


/etc/ssh/sshd_config
Match User <username>
PasswordAuthentication yes
Match all

EC2: TAG : Shutdown

Instance Schedule

09:00 - 21:00 Mon - Sun

AWS : Userdata after every restart

aws.amazon.com/premiumsupport/knowledge-center/execute-user-data-ec2/
https://serverfault.com/questions/797482/how-to-make-ec2-user-data-script-run-again-on-startup


Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0

--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud-config.txt"

#cloud-config
cloud_final_modules:
- [scripts-user, always]

--//
Content-Type: text/x-shellscript; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="userdata.txt"

#!/bin/bash
/bin/echo "Hello World" >> /tmp/testfile.txt
--//--

Monday, October 18, 2021

AWS : Userdata - Bash Script Fired Once

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-user-account-cloud-init-user-data/

docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#retrieving-the-public-key

github.com/Cloud-Yeti/aws-ec2-course/blob/master/labs/lab07-ec2-userdata-ssh-with-password.MD


aws.amazon.com/blogs/aws/troubleshoot-boot-and-networking-issues-with-new-ec2-serial-console/

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html

#!/bin/bash
sed 's/PasswordAuthentication no/PasswordAuthentication yes/' -i /etc/ssh/sshd_config
systemctl restart sshd
service sshd restart


#TODO: replace bob with your desired username
useradd bob
# TODO: replace password123 with desired password and change bob to your username chosen in useradd 
echo "password123" | passwd --stdin bob

------------------------------------------------------------------------------
!/bin/bash
sed 's/PasswordAuthentication no/PasswordAuthentication yes/' -i /etc/ssh/sshd_config
service sshd restart
echo "admin@123" | passwd --stdin root



AWS : SSH Issue - Permission denied

https://stackoverflow.com/questions/36300446/ssh-permission-denied-publickey-gssapi-with-mic


 (publickey,gssapi-keyex,gssapi-with-mic).

ssh -i "CCA_Product.pem" ec2-user@10.79.197.206


docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws

ssh-keygen -m PEM

pem

pub


awsfeed.com/uncategorized/using-ec2-serial-console-to-access-the-grub-menu-and-recover-from-boot-failures


docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-to-serial-console.html#sc-connection-methods


Push your SSH public key to the instance to start a serial console session

aws ec2-instance-connect send-serial-console-ssh-public-key \

    --instance-id i-06a0d8564550494b0 \

    --serial-port 0 \

    --ssh-public-key file://serialAccess.pub \

    --region us-east-1

Connect to the serial console using your private key

ssh -i serialAccess i-06a0d8564550494b0.port0@serial-console.ec2-instance-connect.us-east-1.aws

i-06a0d8564550494b0

Linux : KDE Neon

https://linuxhint.com/install-kde-neon-oracle-virtualbox/


KDE Neon --- Derivative of Ubuntu Linux

Konsole ---- Transparent 

LINUX:TMUX

https://youtu.be/l-lcd1MrSLM

tecmint.com/tmux-to-access-multiple-linux-terminals-inside-a-single-console/

https://askubuntu.com/questions/850055/ctrl-b-c-n-w-etc-not-working-in-tmux-console

https://ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions

https://www.networkworld.com/article/3545370/how-to-use-tmux-to-create-a-multi-pane-linux-terminal-window.htm

tmux

ctrl+b     and  Shift+%    :::  Split Vertically

ctrl+b     and  Shift+"     :::  Split Horizontally

Type "exit" from a particular window To kill that window/screen 

ctrl+b     and  d     :::  End Session

for example, to create a new terminal hold ctrl+b and release it then press shift+5 (%)

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass