Saturday, December 24, 2022

RDPClient_SSL(TsSslEventHandshakeContinueFailed): 2022-12 Cumulative Update for Windows Server 2016 for x64-based Systems (KB5021235)

 Hi there, 

Post installation of this update - "2022-12 Cumulative Update for Windows Server 2016 for x64-based Systems (KB5021235)" on one of the domain controllers in Azure VM.  We started facing a weird RDP Authentication issue where users with even the correct credential failed to take an RDP session of remote systems in another network(site).

After investigating further, We noticed the below warning message in the event log for RDP Service-

RDPClient_SSL: An error was encountered when transitioning from TsSslStateHandshakeInProgress to TsSslStateDisconnecting in response to TsSslEventHandshakeContinueFailed (error code 0x80004005).

In the end, we had to uninstall this CU Update - KB5021235 from the domain controller which has fixed the issue.

So if you're having a similar issue, I request you to please try uninstalling this update or hold for installation. 

Hopefully, the Microsoft update team will fix this issue very soon.

Thank you,

 

Wednesday, December 14, 2022

Learning Linux - Create a simple shell script(Part-2)

 In part 1 of this blog series, We have seen how to work on essential Linux commands. In part 2, We will assist you to understand the basic logic and loop format while creating your first bash script. 

Prerequisites: I am hoping you have basic knowledge and experience with Linux. 

- Use scripting to automate system maintenance tasks

Scripting: #! Shebang - #!/bin/bash , # comment a line or text

- Conditional Logic(if)

IF Example: 

if [condition block] 

then

Command section

elif [condition block] 

then 

Command section

else 

Command section

fi 

    Conditional Operators

              
                

        






   

    -Processing shell command exit codes

        Exit Code: run 'echo $?' post running any command to know the exit code


    - Use Looping constructs (for, etc.) to process file, command line input

For Loop: Perform repetitive tasks 

Example: 

for mission in $(cat mission-names.txt)

do 

create-and-launch-rocket $mission

done

    while Loop usage: wait in the loop until specific condition matches/create infinite loops/Menu driven programs

Example:

while [$rocket_status = "launching"]

do

sleep 2

rocket_status = rocket-status $mission_Name

done

-> echo "Thank You :) "

Tuesday, November 29, 2022

Learning Linux - Essential Commands(Part-1)

As part of this blog series, I am trying to consolidate the most common Linux commands and their usage in a very simplified manner so that you may recall them while you're performing any related tasks.


- Log into the local/remote system
SSH, Telnet, VNC Server/client

- Read, and use System Documentation
command --Help, Manual Pages with man command, 
Searching for commands - apropos, Tab/auto-completion

- Create, Delete, Copy, and Move Files and Directories
Listing files & Directories - ls, absolute path/relative path,
Current/Working Directory - cd, Creating file - touch,
copying file - cp [source] [destination], Move Files - mv [source] [destination]
Deleting files & Directory - rm,

- Create and manage hard links
Introduction to iNode - stat [file], hard link - ln [path_to_target_file] [Path_to_link_file],
Limitations - Only Hard links to files, not folder, Only Hard links to files on same filesystem,

- Create and manage soft links
soft links - ln -s [path_to_target_file] [Path_to_link_file], readlinks [soft link file]

- List, set, and change standard file permissions
Owner & Groups - chown [user] [file], chgrp [group] [file], Files & Directory Permission - 
chmod [permissions] [file/directory], 

- SUID, SGID, and Sticky Bit
SUID - chmod 4664 file, SGID - chmod 2664 file, Stickybit - chmod 1777 file

- Search for files
find [path/to/direcotory] [search parameters], 
                Search Parameters - Name - find -name felix, 
                Search Parameters - Modified time - find -mmin [minute],  
                Search Parameters - file size - find -size [size], 
                Search expressions - find -name "f*" -mmin [minute] # AND Operator, 
                find -name "f*" -o -mmin [minute] # OR Operator,   
                find -not -name "f*" ,  find /! -name "f*" # NOT Operator, 
                # Find files with permissions- find -perm 664 // find -perm u=rw,g=rw,o=r, 
                # Find files with at least permission- find -perm -664 // find -perm -u=rw,g=rw,o=r, 
                # Find files with any of these permissions- find -perm /664 // find -perm /u=rw,g=rw,o=r

- Compare and manipulate file content
cat, tac, tail, head, Transforming text: sed 's/canda/canada/g' file.txt(lookupmode), 
                Sed -i 's/canda/canada/g' file.txt(inplacemode)
cut -d '' -f 1 file.txt(delmitedmode), Uniq & Sort: uniq file.txt, sort file,
Comparing files: diff diff file1 file2, diff -c diff file1 file2 , diff -y diff file1 file2

- Search files using Grep
Searching with grep: grep [option] 'search pattern' file, 
                grep 'centos' /etc/os-release, 
                grep -i 'centos' /etc/os-release(Non-case-insensetive),
grep -r 'centos' /etc/os-release(recursive), 
                grep -ir 'centos' /etc/os-release(Case-Ins.+recursive),                 
                grep -vi 'centos' /etc/os-release(invert-match), 
                grep -wi 'centos' /etc/os-release(words), 
                grep -oi 'centos' /etc/os-release(only-matching), 

- Analyze text using basic regular expressions
Regex Operators: ^, $, ., *, +, {}, ?, |, [], (), [^], 
                The Line Begin with: ^, 
                The line End with: $, 
                Match AnyONE Characters: . Example: grep -r 'c.t' /etc/,
Escape for special characters: \: Example: grep '\.' \etc\login.defs, 
                Match the previous element o or more matches: *, 

- Extended Regular Expressions
Previous elements can exist "this many" times: {}, Example: egrep -r '10{,3}' /etc/, 
                Make the previous element optional: ?, Example: egrep -r 'disabled?' /etc/, 
                Match one thing or the other: |, Example: egrep -ir 'enabled?|disabled?' /etc/, 
                Range or Sets: [], Example: egrep -r 'c[au]t' /etc/, 

-  Use input-output redirection (>, >>, |, 2>, etc.)
Stdin(<), stdout(1>, >), and stderr(2>), Redirection: >, >> , 
                Example: over right, date > output.txt, 
                append, date >> output.txt 
                heredoc(<<EOF) and here string(<<<) 
                Example: sort <<EOF .Input value. > EOF (Here Document or heredoc), 
                bc <<< 1+3+6 == 10(here string)

- Archive, backup, compress, unpack, and uncompress files
1. Archiving, 2. Compression, 3. Backup
tar = tape archive, 
                Listing: tar --list --file archive.tar, 
                Creating tar file: tar --create --file archive.tar file1, 
                Add to exising archive: tar --append --file archive.tar file1,
Extracting: tar --extract --file archive.tar --directory /tmp/

- Compress and Uncompress files
Common archiving tools: tar, zip 
Common Compress and Uncompress tools: gzip, bzip2, xz
Compress: gzip file1, bzip2 file2 xz file3, 
                Decompression: 
                 gunzip file.gz or gzip --Decompress file.gz, 
                 bunzip file.bz2 or bzip2 --Decompress file.bz2,
unxz file.xz or xz --Decompress file.xz

Common Compress and Uncompress with tar: 
                 tar --create --file archive.tar file1, 
                 tar --create --gzip --file archive.tar.gz file1(with combining gzip),
tar --create --bzip2 --file archive.tar.bz2 file1(with combining bzip2), 
                tar --create --xz --file archive.tar.xz file1(with combining xz)
Autocompress: 
                 tar --create --autocompress --file archive.tar.gz file1(Select compression utility automatically), 
                 tar --extract --file    archive.tar.gz 

- Backup files to a Remote System
Syncing two Directories: 
                rsync, Example: rsync -a pictures/ aroon@9.9.83.2:/home/aroon/pictures/
Disk Imaging: dd, 
                 Example: sudo dd if=/dev/vda of=diskimage.raw bs=1M status=progress

- Securely transfer files between systems
Securely transfer files: 
                 scp, Example: scp aaron@192.168.1.27:/home/aaron/myfule.tgz /home/aaron/myfiles.tgz (Copy from remote to local), 
                 scp /home/aaron/my_archive.tar aaron@192.168.1.27:/home/aaron/my_archive.tar (local to remote), 
                 scp aaron@192.168.2.37:/home/aaron/my_archive.tar aaron@192.168.1.27:/home/aaron/my_archive.tar ( remote to remote)

Securely transfer files: sftp, Example: sftp aaron@192.168.1.27(connecting sftp server), 
                 get family.jpg (interactive command(get) to download to local), 
                 get -r /picture (interactive command(get) to download recursive to local), 
                 put family.jpg (interactive command to upload to local),  
                 put -r /my_pictures (interactive command to upload recursive  to local)




-> echo "Thank You :) "