All posts by Pramod T P

Magento 2 disable captcha from admin login form

Disable Using Command Line

php bin/magento config:set admin/captcha/enable 0
php bin/magento cache:flush

Disable Directly in Database

UPDATE core_config_data
SET value = 0
WHERE path = ‘admin/captcha/enable’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/fonts%’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/mode’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/forms%’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/enable%’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/always_for%’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/type%’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/timeout%’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/failed_attempts_logging%’;

DELETE FROM core_config_data WHERE path LIKE ‘admin/captcha/max_attempts%’;

YAML

YAML stands for “Yet Another Markup Language”. It’s a strict superset of JSON, which means that YAML can do everything JSON can and more.

  • Configuration files: YAML is a popular choice for creating configuration files because it’s human-readable and works with any programming language. YAML files are often used in Kubernetes to configure pods, services, and deployments.
  • Data serialization: YAML is a data serialization language that can be used to convert data to and from other formats, such as JSON. YAML is a good choice when human readability is important.
  • Documentation: YAML’s human-readable format makes it a good choice for documentation.
  • Log files: YAML can be used to create clean, intuitive log files.
  • API and web services: YAML can be used to write API definitions for popular API specifications, such as OpenAPI and AsyncAPI.
  • Metadata: YAML can be used to store and organize metadata and content structure.
  • Machine learning: YAML can be used to define and orchestrate the steps involved in the machine learning lifecycle, such as data ingestion, model training, and evaluation.

Install Elasticsearch

Import the Elasticsearch GPG key:
# wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg –dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg

Add the Elasticsearch repository:
# echo “deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main” | sudo tee /etc/apt/sources.list.d/elastic-8.x.list

Update the apt package manager and install Elasticsearch:
# apt update && apt install elasticsearch

Start and enable the Elasticsearch service:
# systemctl start elasticsearch
# systemctl enable elasticsearch

Open the elasticsearch.yml file for editing:

sudo nano /etc/elasticsearch/elasticsearch.yml

Replace the following setting with ‘false’ to disable Magento security features:
# Enable security features
xpack.security.enabled: false
Save the changes to the elasticsearch.yml file.

Restart the Elasticsearch service to apply the configuration:

# systemctl restart elasticsearch.service

Verify that Elasticsearch runs correctly using the curl command:

# curl -X GET “localhost:9200/”
If Elasticsearch is working correctly, you’ll receive an output like this:
{
“name” : “ubuntu”,
“cluster_name” : “elasticsearch”,
“cluster_uuid” : “KPbFKCVLT9uu-RFxzxH_Bw”,
“version” : {
“number” : “8.6.2”,
“build_flavor” : “default”,
“build_type” : “deb”,
“build_hash” : “2d58d0f136141f03239816a4e360a8d17b6d8f29”,
“build_date” : “2023-02-13T09:35:20.314882762Z”,
“build_snapshot” : false,
“lucene_version” : “9.4.2”,
“minimum_wire_compatibility_version” : “7.17.0”,
“minimum_index_compatibility_version” : “7.0.0”
},
“tagline” : “You Know, for Search”
}