Unable to start Elasticsearch as a service

I also tried to reset the password for Kibana based on this post:
I lost the password that has been changed
I am getting this error for both users Elastic and Kibana.

[root@jcpvirtualserver-new ~]# curl -u elastic:1QdjDELm7ITSikVh -XPUT -k 'https://localhost:9200/_xpack/security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d' {  "password" : "janssenelastic" } '
{
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "unable to authenticate user [elastic] for REST request [/_xpack/security/user/elastic/_password?pretty]",
        "header" : {
          "WWW-Authenticate" : [
            "Basic realm=\"security\" charset=\"UTF-8\"",
            "Bearer realm=\"security\"",
            "ApiKey"
          ]
        }
      }
    ],
    "type" : "security_exception",
    "reason" : "unable to authenticate user [elastic] for REST request [/_xpack/security/user/elastic/_password?pretty]",
    "header" : {
      "WWW-Authenticate" : [
        "Basic realm=\"security\" charset=\"UTF-8\"",
        "Bearer realm=\"security\"",
        "ApiKey"
      ]
    }
  },
  "status" : 401
}

[root@jcpvirtualserver-new ~]# curl -u elastic:1QdjDELm7ITSikVh -XPUT -k 'https://localhost:9200/_xpack/security/user/kibana/_password?pretty' -H 'Content-Type: application/json' -d' {  "password" : "janssenkibana" } '
{
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "unable to authenticate user [elastic] for REST request [/_xpack/security/user/kibana/_password?pretty]",
        "header" : {
          "WWW-Authenticate" : [
            "Basic realm=\"security\" charset=\"UTF-8\"",
            "Bearer realm=\"security\"",
            "ApiKey"
          ]
        }
      }
    ],
    "type" : "security_exception",
    "reason" : "unable to authenticate user [elastic] for REST request [/_xpack/security/user/kibana/_password?pretty]",
    "header" : {
      "WWW-Authenticate" : [
        "Basic realm=\"security\" charset=\"UTF-8\"",
        "Bearer realm=\"security\"",
        "ApiKey"
      ]
    }
  },
  "status" : 401
}

Is there any other way to authenticate the built-in users?

Regards,
Pavan