среда, 17 июня 2020 г.

ssh keys access with no password

SSH Client : 192.168.0.12 ( Fedora 21 ) 
SSH Remote Host : 192.168.0.11 ( CentOS 7 )

Step 1: Create Authentication SSH-Keygen Keys on – (192.168.0.12)

[tecmint@tecmint.com ~]$ ssh-keygen -t rsa

Step 2: Create .ssh Directory on – 192.168.0.11

[tecmint@tecmint ~]$ ssh sheena@192.168.0.11 mkdir -p .ssh

Step 3: Upload Generated Public Keys to – 192.168.0.11

[tecmint@tecmint ~]$ cat .ssh/id_rsa.pub | ssh sheena@192.168.0.11 'cat >> .ssh/authorized_keys'

Step 4: Set Permissions on – 192.168.0.11

[tecmint@tecmint ~]$ ssh sheena@192.168.0.11 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"


Step 5: Login from 192.168.0.12 to 192.168.0.11 Server without Password

[tecmint@tecmint ~]$ ssh sheena@192.168.0.11

пятница, 12 июня 2020 г.

awk make lower or upper case register

1) Make script

#!/bin/bash
echo "$1" | awk '{print tolower($0)}'
echo "$1" | awk '{print toupper($0)}'

2) make it executable
chmod +x make_low.sh

3) use

./make_low.sh   ASDASDASD
asdasdasd