<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jeg</title>
    <description>The latest articles on DEV Community by Jeg (@sjegadeeswaran).</description>
    <link>https://dev.to/sjegadeeswaran</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F937436%2F2d11b205-b35d-47a2-9751-a0e2187b0611.JPG</url>
      <title>DEV Community: Jeg</title>
      <link>https://dev.to/sjegadeeswaran</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sjegadeeswaran"/>
    <language>en</language>
    <item>
      <title>Trivy command lines</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Wed, 11 Feb 2026 04:41:37 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/trivy-command-line-1715</link>
      <guid>https://dev.to/sjegadeeswaran/trivy-command-line-1715</guid>
      <description>&lt;p&gt;&lt;code&gt;&lt;br&gt;
trivy image nginx:1.23.2-perl&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above command will scan by updating the vulnerability database, which takes around one minute. &lt;br&gt;
Shortly after, a flood of scan results is displayed.&lt;/p&gt;

&lt;p&gt;Each result includes the following columns from left to right:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Library: The name of the library or package that contains the vulnerability
Vulnerability: The identifier of the vulnerability in the CVE (Common Vulnerabilities and Exposures) database
Severity: The severity of the vulnerability as determined by the CVSS (Common Vulnerability Scoring System) score and categorized into UNKNOWN, LOW, MEDIUM, HIGH, and CRITICAL
Installed Version: The version of the library or package that is installed in the image
Fixed Version: The version of the library or package that fixes the vulnerability
Title: The title of the vulnerability and a link to more details
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Reissuing the same command: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
trivy image nginx:1.23.2-perl &lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The vulnerability database is cached and the command completes much faster the second time.&lt;/p&gt;

&lt;p&gt;You will have to determine what level of severity is acceptable for your organization. &lt;br&gt;
You can filter the vulnerabilites by severity using the --severity option.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
trivy image --severity HIGH,CRITICAL nginx:1.23.2-perl&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The list of vulnerabilities is much shorter and only includes the vulnerabilities that are of high or critical severity. &lt;br&gt;
  As time goes on, new vulnerabilities are discovered and the list may grow. &lt;br&gt;
  That is why it is important to keep periodically scan your images to have a current understanding of risk.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
trivy image nginx:1.23.2-alpine&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The scan results are much shorter because the alpine image is based on a much smaller base image containing fewer libraries and packages. &lt;/p&gt;

&lt;p&gt;The alpine image is said to have a smaller attack surface than the perl image.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
trivy image --format json --output /home/ubuntu/nginx.json nginx:1.23.2-alpine&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
  Scan results can be saved to a JSON file for future analysis.&lt;/p&gt;

</description>
      <category>trivy</category>
      <category>security</category>
      <category>containers</category>
    </item>
    <item>
      <title>Scan container images used by pods running in a Kubernetes namespace</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Tue, 10 Feb 2026 06:17:10 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/scan-container-images-used-by-pods-running-in-a-kubernetes-namespace-4inl</link>
      <guid>https://dev.to/sjegadeeswaran/scan-container-images-used-by-pods-running-in-a-kubernetes-namespace-4inl</guid>
      <description>&lt;p&gt;Below is a shell script that will scan all the images in the kubernetes-dashboard namespace and save the results to JSON files:&lt;/p&gt;

&lt;p&gt;cat &amp;lt;&amp;lt; 'EOF' &amp;gt; scan_images.sh&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

namespace="kubernetes-dashboard"
# create a directory for the scan results
mkdir -p $namespace 

# get a list of all the images used by Pods in the Namespace
images=($(kubectl get pods -n $namespace -o jsonpath='{.items[*].spec.containers[*].image}' | sort | uniq))

# loop through the images and scan each one
for image in ${images[@]}; do
    echo "Scanning image: $image"
    # Scan the image with --scanners vuln to skip scanning for secrets to speed up the scan (for demonstration purposes)
    trivy image --severity HIGH,CRITICAL $image --scanners vuln --quiet --format json --output $namespace/$(basename $image).json
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;EOF&lt;/p&gt;

&lt;p&gt;The script uses a kubectl command to get a list of all the images used by Pods in the kubernetes-dashboard Namespace.&lt;/p&gt;

&lt;p&gt;The script could be modified to scan all the images in the cluster but only one Namespace is considered to reduce the amount of time.&lt;/p&gt;

&lt;p&gt;bash scan_images.sh&lt;/p&gt;

&lt;p&gt;The results are saved to JSON files.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>containers</category>
      <category>kubernetes</category>
      <category>security</category>
    </item>
    <item>
      <title>Kyverno - Namespace restriction policy</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Sun, 11 May 2025 06:56:24 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/kyverno-namespace-restriction-policy-5c9n</link>
      <guid>https://dev.to/sjegadeeswaran/kyverno-namespace-restriction-policy-5c9n</guid>
      <description>&lt;p&gt;Following are the helm commands to install kyverno using helm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
helm repo add kyverno https://kyverno.github.io/kyverno
helm repo update
helm install kyverno kyverno/kyverno -n kyverno --create-namespace

To uninstall kyverno from helm:
helm uninstall kyverno -n kyverno

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Chart version: 3.4.1&lt;br&gt;
Kyverno version: v1.14.1&lt;/p&gt;

&lt;p&gt;The following components will get installed in the cluster:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CRDs&lt;/li&gt;
&lt;li&gt;Admission controller&lt;/li&gt;
&lt;li&gt;Reports controller&lt;/li&gt;
&lt;li&gt;Cleanup controller&lt;/li&gt;
&lt;li&gt;Background controller&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;kyverno.yaml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: namespace-restriction
spec:
  rules:
  - name: require namespace standard names
    match:
      any:
      - resources:
          kinds:
          - Namespace
    validate:
      failureAction: Enforce
      message: "You must have the proper naming standard for namespace creation"
      pattern:
        metadata:
            name: dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding multiple values with "or" condition for the namespace names:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: namespace-restriction
spec:
  rules:
  - name: require namespace standard names
    match:
      any:
      - resources:
          kinds:
          - Namespace
    validate:
      failureAction: Enforce
      message: "You must have the proper naming standard for namespace creation"
      pattern:
        metadata:
            name: app-poc-* | app-prod-* | app-test*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get ClusterPolicy
NAME                    ADMISSION   BACKGROUND   READY   AGE     MESSAGE

namespace-restriction   true        true         True    2m49s   Ready

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The namespace yaml is now created with a different namespace name:&lt;/p&gt;

&lt;p&gt;namespace.yaml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
apiVersion: v1
kind: Namespace
metadata:
  name: development
  labels:
    name: development
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Following is the error thrown:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error from server: error when creating "namespace.yaml": admission webhook "validate.kyverno.svc-fail" denied the request: 

resource Namespace//development was blocked due to the following policies 

namespace-restriction:
  require namespace standard names: 'validation error: You must have the proper naming
    standard for namespace creation. rule require namespace standard names failed
    at path /metadata/name/'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By applying the policy, the existing pods and namespace will not get disturbed. The cluster policy is for the entire cluster.&lt;/p&gt;

&lt;p&gt;Yaml file to install kyverno from Argocd:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: kyverno
  namespace: argocd
spec:
  destination:
    namespace: kyverno
    server: https://kubernetes.default.svc
  project: default
  source:
    chart: kyverno
    repoURL: https://kyverno.github.io/kyverno
    targetRevision: 3.4.1
  syncPolicy:
    automated:
      prune: true
      selfHeal: false
    syncOptions:
      - CreateNamespace=true
      - Replace=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>kyverno</category>
      <category>kubernetes</category>
      <category>namespacerestriction</category>
      <category>clusterpolicy</category>
    </item>
    <item>
      <title>Docker: [output clipped, log limit 2MiB reached]</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Thu, 29 Feb 2024 14:27:11 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/docker-output-clipped-log-limit-2mib-reached-5h5l</link>
      <guid>https://dev.to/sjegadeeswaran/docker-output-clipped-log-limit-2mib-reached-5h5l</guid>
      <description>&lt;p&gt;Sometimes the builds inititated from Dockerfile would be taking longer time to complete than usual. This depends on the step we write in the Dockerfile and the process it would take to complete that particular step as a layer. &lt;/p&gt;

&lt;p&gt;If an entire project wants to get built as a docker image then we may end up with log limiting issues in docker depending on the specification of the VM where the docker is installed. &lt;/p&gt;

&lt;p&gt;If an error pops up like: "docker clipped log limit", please follow the configuration provided below to get it resolved.&lt;/p&gt;

&lt;p&gt;Configuration to be added in the docker.service file. &lt;/p&gt;

&lt;p&gt;Navigate to the below location:&lt;br&gt;
/etc/systemd/system/multi-user.target.wants/&lt;/p&gt;

&lt;p&gt;edit the file "docker.service"&lt;/p&gt;

&lt;p&gt;Then, under the [Service] tag, add the environment variables:&lt;br&gt;
Environment="BUILDKIT_STEP_LOG_MAX_SIZE=95971520"&lt;br&gt;
Environment="BUILDKIT_STEP_LOG_MAX_SPEED=7048576"&lt;/p&gt;

&lt;p&gt;This would increase the log size in docker.&lt;/p&gt;

</description>
      <category>outputclipped</category>
      <category>docker</category>
      <category>loglimit</category>
    </item>
    <item>
      <title>Kubernetes memory management across node pools</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Thu, 22 Feb 2024 06:30:54 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/kubernetes-memory-management-across-node-pools-3gmk</link>
      <guid>https://dev.to/sjegadeeswaran/kubernetes-memory-management-across-node-pools-3gmk</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo63319wkgnegw5448rgw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo63319wkgnegw5448rgw.png" alt=" " width="729" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CPU and Memory is not shared to aks-nodepool1-13324706-vmss000032 node.&lt;/p&gt;

&lt;p&gt;The reason is that, we have two different node pools. So memory cannot be shared across two node pools. It can only be shared across nodes.&lt;/p&gt;

&lt;p&gt;So we may need to have single nodepool with nodes to share the memory or use tool called Karpenter (deploy as pods) to share the memory across multiple node pools or configure pods to deploy in specific nodes or use autoscaling.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>nodepools</category>
      <category>memorymanagement</category>
      <category>aks</category>
    </item>
    <item>
      <title>Azure pipelines - Passing variables across stages</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Sat, 17 Feb 2024 10:50:43 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/azure-pipelines-passing-variables-across-stages-268i</link>
      <guid>https://dev.to/sjegadeeswaran/azure-pipelines-passing-variables-across-stages-268i</guid>
      <description>&lt;p&gt;The following code block explains passing the variable 'agentvalue' to the StopVM stage. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code explanation&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;In the StartVM stage, the variable 'agentvalue' is declared and the agentname value is assigned to the variable 'agentvalue'. Task name 'setagentname' has to be defined for the task if a variable is defined.&lt;/p&gt;

&lt;p&gt;In the StopVM stage, the variable called 'VirtualMachine' is created to access the output of agentvalue. The 'VirtualMachine' is accessed only within that stage. &lt;br&gt;
Any variable can only be accessed within that stage after defined.&lt;/p&gt;

&lt;p&gt;The dependsOn condition on the StopVM stage is dependent with StartVM and Cleanup stages to complete their executions to continue with StopVM stage.&lt;/p&gt;

&lt;p&gt;By default in azure pipelines, the second stage is dependent to the first stage - third to second and so on. If we have only the second stage (Build stage) and StopVM stage, then these two stages will be executed parallely once StartVM stage is completed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;To use the output from a different stage, the format for referencing variables is stageDependencies.STAGE.JOB.outputs['TASK.VARIABLE']&lt;/p&gt;

&lt;p&gt;To reference a variable from a task from a different job, use dependencies.JOB.outputs['TASK.VARIABLE']&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
  - none 

name: $(TeamProject)-$(SourceBranchName)-$(Build.BuildId)-$(Hours)$(Minutes)$(Seconds)-$(Date:yyyyMMdd)$(Rev:.r)

pool:
  name: test

parameters:
- name: WarGeneration
  displayName: Run WarGeneration
  type: boolean
  default: false

stages:
- stage: StartVM
  displayName: StartVM
  jobs:
  - job: StartVM
    timeoutInMinutes: 0
    displayName: StartVM
    pool:
      name: Azure Pipelines
    steps:
    - checkout: none
    - task: AzureKeyVault@2
      inputs:
        azureSubscription: 'xxx'
        KeyVaultName: 'xxx'
        SecretsFilter: 'xxx,yyy'
        RunAsPreJob: true
    - task: CmdLine@2
      inputs:
        script: |
          az login --service-principal --username $(xxx) --password $(xxx)  --tenant $(xxx)
                                                      flag=true;
                                                          echo $flag
                                                          while ($flag); do
                                                          vmstatusvm1=`az vm show -g xxx -n vm1 -d --query powerState -o tsv`
                                                          vmnamevm1=`az vm show -g xxx -n vm1 -d --query name -o tsv`
                                                          vmstatusvm2=`az vm show -g xxx -n vm2 -d --query powerState -o tsv`
                                                          vmnamevm2=`az vm show -g xxx -n vm2 -d --query name -o tsv`

                                                          if [[ $vmstatusvm1 == 'VM deallocate' &amp;amp;&amp;amp; $vm1 == 'vm1' ]]; then
                                                            agentname=vm1
                                                            echo $agentname
                                                            az vm start --resource-group xxx --name $agentname
                                                            echo "##vso[task.setvariable variable=agentvalue;isOutput=true]$agentname"
                                                            flag=false
                                                           elif [[ $vmstatusvm2 == 'VM deallocated' &amp;amp;&amp;amp; $vm2 == 'vm2' ]]; then
                                                            agentname=vm2
                                                            echo $agentname
                                                            az vm start --resource-group xxx --name $agentname
                                                            echo "##vso[task.setvariable variable=agentvalue;isOutput=true]$agentname"
                                                            flag=false
                                                          else
                                                            echo "There are no VM's available to trigger a new build."
                                                          fi  
                                                          done


      name: setagentname    



- stage: Build
  displayName: Build stage
  jobs:
  - job: Build
    timeoutInMinutes: 0
    displayName: Build
    steps:
    - checkout: none
    - task: Bash@3
      inputs:
        targetType: 'inline'
        script: |
          echo "Printing virtual none"

- ${{ if eq(parameters.WarGeneration, true) }}:
  - stage: WarGeneration
    displayName: WarGeneration
    jobs:
    - job: War
      timeoutInMinutes: 0 
      displayName: War
      pool:
        name: test
        demands:
        - Agent.OS -equals Linux
      steps:
      - checkout: none            
      - task: AzureKeyVault@2
        inputs:
          azureSubscription: 'xxx'
          KeyVaultName: 'xxx'
          SecretsFilter: 'xxx'
          RunAsPreJob: true

- stage: Cleanup
  displayName: Cleanup stage
  condition: always()
  jobs:
  - job: CleanupJob
    timeoutInMinutes: 0 
    displayName: Cleanup Job
    pool:
     name: test
     demands:
     - Agent.OS -equals Linux
    steps:
      - checkout: none    
      - task: PowerShell@2
        displayName: Cleanup Task
        inputs:
          targetType: 'inline'
          script: |
            echo "Cleanup"

- stage: StopVM
  displayName: StopVM stage
  dependsOn:
  - StartVM
  - Cleanup
  condition:  always()
  variables:
    - name: VirtualMachine
      value: $[ stageDependencies.StartVM.StartVM.outputs['setagentname.agentvalue'] ]
  jobs:
  - job: StopVM
    timeoutInMinutes: 0
    displayName: StopVM
    pool:
      name: Azure Pipelines
    steps:
    - checkout: none
    - task: AzureKeyVault@2
      inputs:
        azureSubscription: 'xxx'
        KeyVaultName: 'xxx'
        SecretsFilter: 'xxx,yyy'
        RunAsPreJob: true

    - task: Bash@3
      inputs:
        targetType: 'inline'
        script: |
         az login --service-principal --username $(xxx) --password $(xxx)  --tenant $(xxx)
         az vm deallocate --resource-group xxx --name $(VirtualMachine)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reference link:&lt;/p&gt;

&lt;p&gt;[Use outputs in a different stage - section from link]&lt;br&gt;
&lt;a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&amp;amp;tabs=yaml%2Cbatch#set-in-script" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&amp;amp;tabs=yaml%2Cbatch#set-in-script&lt;/a&gt;&lt;/p&gt;

</description>
      <category>azuredevops</category>
      <category>azurepipelinesvariables</category>
      <category>azurepipelinesstages</category>
    </item>
    <item>
      <title>Creating user with an expiry date in Linux</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Sat, 11 Nov 2023 10:47:09 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/creating-user-with-an-expiry-date-in-linux-53nd</link>
      <guid>https://dev.to/sjegadeeswaran/creating-user-with-an-expiry-date-in-linux-53nd</guid>
      <description>&lt;p&gt;Steps to create an user with an expiry date in Linux:&lt;/p&gt;

&lt;p&gt;sudo useradd -e YYYY-MM-DD username&lt;/p&gt;

&lt;p&gt;useradd is a command used to add a new user account. &lt;br&gt;
-e YYYY-MM-DD specifies the expiry date for a new user account. &lt;/p&gt;

&lt;p&gt;Reference Link: &lt;a href="https://www.geeksforgeeks.org/creating-a-user-with-an-expiry-date-in-linux/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/creating-a-user-with-an-expiry-date-in-linux/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>expirydate</category>
      <category>useradd</category>
    </item>
    <item>
      <title>Disabling root login [CentOs]</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Fri, 10 Nov 2023 01:57:41 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/disabling-root-login-centos-4190</link>
      <guid>https://dev.to/sjegadeeswaran/disabling-root-login-centos-4190</guid>
      <description>&lt;p&gt;To disable the root login [CentOs]:&lt;/p&gt;

&lt;p&gt;sudo passwd root [to change the password for root user if needed].&lt;/p&gt;

&lt;p&gt;sudo vi /etc/ssh/sshd_config&lt;br&gt;
PermitRootLogin no&lt;br&gt;
sudo systemctl restart sshd&lt;/p&gt;

&lt;p&gt;ssh root@ip;&lt;br&gt;
You should not be allowed to login [Permission denied, error]&lt;/p&gt;

&lt;p&gt;Reference URL: &lt;a href="https://www.tecmint.com/disable-ssh-root-login-in-linux/" rel="noopener noreferrer"&gt;https://www.tecmint.com/disable-ssh-root-login-in-linux/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>centos</category>
      <category>disablerootlogin</category>
    </item>
    <item>
      <title>Creating Linux user without home directory</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Sat, 04 Nov 2023 15:37:12 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/creating-linux-user-without-home-directory-1kfk</link>
      <guid>https://dev.to/sjegadeeswaran/creating-linux-user-without-home-directory-1kfk</guid>
      <description>&lt;p&gt;To create a linux user without home directory:&lt;/p&gt;

&lt;p&gt;sudo useradd --no-create-home john&lt;br&gt;
or&lt;br&gt;
sudo useradd -M john&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo: Grants administrative privileges.
useradd: Adds a new user
-M or --no-create-home: Skips creating a home directory for the new user.
john: Creates a new user named john.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Reference URL: &lt;a href="https://linuxsimply.com/ubuntu-create-user-without-home-directory/" rel="noopener noreferrer"&gt;https://linuxsimply.com/ubuntu-create-user-without-home-directory/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>useradd</category>
      <category>nohomedirectory</category>
      <category>linux</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Create a group - Linux</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Tue, 31 Oct 2023 04:18:04 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/create-a-group-linux-99l</link>
      <guid>https://dev.to/sjegadeeswaran/create-a-group-linux-99l</guid>
      <description>&lt;p&gt;&lt;strong&gt;To Create a group&lt;/strong&gt;:&lt;br&gt;
Syntax: sudo groupadd groupname&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To add the user to the group&lt;/strong&gt;:&lt;br&gt;
Syntax: sudo usermod -a -G groupname username&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To create the user&lt;/strong&gt;:&lt;br&gt;
Syntax: sudo useradd username&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference URL's&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://linuxize.com/post/how-to-add-user-to-group-in-linux/" rel="noopener noreferrer"&gt;https://linuxize.com/post/how-to-add-user-to-group-in-linux/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/" rel="noopener noreferrer"&gt;https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>groupadd</category>
      <category>useradd</category>
    </item>
    <item>
      <title>Create user in Linux and set its UID and home directory</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Tue, 24 Oct 2023 06:32:05 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/create-user-in-linux-and-set-its-uid-and-home-directory-1jkb</link>
      <guid>https://dev.to/sjegadeeswaran/create-user-in-linux-and-set-its-uid-and-home-directory-1jkb</guid>
      <description>&lt;h2&gt;
  
  
  To create a user named james and set its UID to 1859 and home directory to /var/www/james
&lt;/h2&gt;

&lt;p&gt;By default useradd creates the user’s home directory in /home. If you want to create the user’s home directory in other location, use the d (--home) option.&lt;/p&gt;

&lt;p&gt;On most Linux distributions, when creating a new user account with useradd, the user’s home directory is not created.&lt;/p&gt;

&lt;p&gt;Use the -m (--create-home) option to create the user home directory as /home/username:&lt;/p&gt;

&lt;p&gt;sudo useradd -m username&lt;/p&gt;

&lt;p&gt;sudo useradd -u 1859 -m -d  /var/www/james james&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To verify id of an user&lt;/strong&gt;&lt;br&gt;
id -u username&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To change after creating user&lt;/strong&gt;&lt;br&gt;
sudo usermod -u 1859 kirsty&lt;/p&gt;

&lt;p&gt;Reference link: &lt;a href="https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/" rel="noopener noreferrer"&gt;https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>useradd</category>
      <category>uid</category>
      <category>linux</category>
    </item>
    <item>
      <title>Getting the latest tagged image to the AKS cluster while deploying the application</title>
      <dc:creator>Jeg</dc:creator>
      <pubDate>Tue, 25 Oct 2022 05:37:26 +0000</pubDate>
      <link>https://dev.to/sjegadeeswaran/getting-the-latest-tagged-image-to-the-aks-cluster-while-deploying-the-application-4n9g</link>
      <guid>https://dev.to/sjegadeeswaran/getting-the-latest-tagged-image-to-the-aks-cluster-while-deploying-the-application-4n9g</guid>
      <description>&lt;p&gt;I came across a scenario where the application is developed and built as a docker image with the tag (xxx.azurecr.io/sampleimage:latest). Then the built docker image is pushed to the Azure container registry.&lt;/p&gt;

&lt;p&gt;The pushed docker image is then deployed in the AKS cluster using kubectl apply -f filename.yaml&lt;/p&gt;

&lt;p&gt;Now, the code base is updated and the docker image is also updated with the same tag (xxx.azurecr.io/sampleimage:latest) and pushed to the container registry. The container registry is now having an image with the latest code base.&lt;/p&gt;

&lt;p&gt;For the latest image (the one which is updated 2nd time - as mentioned above) to get deployed in the AKS cluster, we need to use imagePullPolicy as Always in the yaml files. If it is not set, the AKS cluster would only take the already available image (the one which is pushed first) from the cluster.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-tomcat-helloworld
  labels:
    app: test-tomcat-helloworld
spec:
  replicas: 1
  selector:
    matchLabels:
      app: test-tomcat-helloworld
  template:
    metadata:
      labels:
        app: test-tomcat-helloworld
    spec:
      containers:
      - name: test-tomcat-helloworld
        image: cicdcontainervol.azurecr.io/test-tomcat-helloworld:v1
        imagePullPolicy: Always
        resources:
          limits:
            memory: "2Gi"
            cpu: "1200m"
        ports:
        - containerPort: 8080
      imagePullSecrets:
      - name: secret
---
apiVersion: v1
kind: Service
metadata:
    name: test-tomcat-helloworld
    annotations:
      service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
    type: LoadBalancer
    loadBalancerIP: xx.xx.xxx.xx
    ports:
    - port: 8080
      targetPort: 8080
    selector:
        app: test-tomcat-helloworld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fry9n6huhzjutdwszj7qn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fry9n6huhzjutdwszj7qn.png" alt=" " width="800" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aks</category>
      <category>imagepullpolicy</category>
      <category>imagetagging</category>
      <category>applicationdeploymen</category>
    </item>
  </channel>
</rss>
