কম্পিউটার

How to Protect Login page with HTTP প্রমাণীকরণ?

HTTP প্রমাণীকরণের সাথে পাসওয়ার্ড সুরক্ষিত লগইন পৃষ্ঠা: 60 মিলিয়ন ওয়ার্ডপ্রেস ওয়েবসাইট রয়েছে যা এটিকে বিশ্বের সবচেয়ে জনপ্রিয় ওয়েবসাইট তৈরির প্ল্যাটফর্ম করে তোলে। কিন্তু এই জনপ্রিয়তার একটা দাম আছে। ওয়ার্ডপ্রেস সাইটে দিনের প্রতিটি মিনিটে প্রায় 90,978টি হ্যাক করার চেষ্টা করা হয়। যদিও হ্যাকাররা একটি ওয়েবসাইটে ভাঙার জন্য বিভিন্ন পদ্ধতি ব্যবহার করে, একটি খুব জনপ্রিয় এবং বহুল ব্যবহৃত একটিকে বলা হয় ব্রুট ফোর্স অ্যাটাক। এই ধরনের আক্রমণে, হ্যাকাররা আপনার লগইন শংসাপত্রগুলি সঠিকভাবে অনুমান করার জন্য প্রোগ্রাম বটগুলি চেষ্টা করে যার কারণে আপনাকে অবশ্যই আপনার ওয়ার্ডপ্রেস লগইন পৃষ্ঠাটি রক্ষা করতে হবে৷

লগইন সুরক্ষা সম্পর্কে পূর্ববর্তী পোস্টে, আমরা একটি অনন্য ব্যবহারকারীর নাম নিয়ে আসা এবং শক্তিশালী পাসওয়ার্ড প্রয়োগ করার বিষয়ে আলোচনা করেছি। এটি আপনার সাইট থেকে হ্যাকার বটগুলিকে দূরে রাখার একটি কার্যকর উপায়, কিন্তু যখন এটি নিরাপত্তার কথা আসে, তখন কোনও সম্পূর্ণ গ্যারান্টি নেই যে একটি সাইট নিরাপদ থাকবে৷ ইন্টারনেট কখনই খুব নিরাপদ জায়গা ছিল না, এবং কোনও পরিমাণ নিরাপত্তা কখনও যথেষ্ট নয়৷ তাই আপনার সাইটের সুরক্ষার অনেক স্তর থাকা ভালো৷৷ যদিও একটি অনন্য ব্যবহারকারীর নাম এবং পাসওয়ার্ড গুরুত্বপূর্ণ, লগইন পৃষ্ঠাটি লক করাও নিরাপত্তার দিকে একটি গুরুত্বপূর্ণ পদক্ষেপ। এটি করার একটি উপায় হল HTTP প্রমাণীকরণের সাথে লগইন পৃষ্ঠাটিকে পাসওয়ার্ড সুরক্ষিত করা। এই পোস্টে, আমরা আপনাকে দেখাব কিভাবে আপনি এটি অর্জন করতে পারেন।

HTTP প্রমাণীকরণ কি?

HTTP প্রমাণীকরণ বা HTTP বেসিক প্রমাণীকরণ (BA) হল লগইন পৃষ্ঠায় সীমাবদ্ধ অ্যাক্সেস কার্যকর করার একটি কৌশল। একটি সাধারণ উপমা আঁকতে, একটি ওয়েবসাইটকে একটি ঘর হিসাবে ভাবুন। প্রধান দরজা হল লগইন পৃষ্ঠা। লোকেরা ঘরে ঢোকার চেষ্টা করতে পারে যার কারণে আপনাকে একটি শক্ত তালা রাখতে হবে। লকটি লগইন শংসাপত্রের জন্য দাঁড়িয়েছে, প্রধান দরজার বাইরে, একটি বেড়া রয়েছে যা বাড়ির অতিরিক্ত সুরক্ষা প্রদান করে। একইভাবে, HTTP প্রমাণীকরণ আপনার বাড়িতে অতিরিক্ত সুরক্ষার একটি স্তর সরবরাহ করে। এর মানে যে কেউ লগইন পৃষ্ঠা অ্যাক্সেস করতে চায় তাকে প্রথমে HTTP প্রমাণীকরণ (বেড়া) এবং লগইন শংসাপত্র (প্রধান গেট) দিয়ে যেতে হবে।

How to Protect Login page with HTTP প্রমাণীকরণ ?

HTTP প্রমাণীকরণের মাধ্যমে আপনার ওয়ার্ডপ্রেস সাইটকে সুরক্ষিত করতে প্রথমে আপনাকে একটি .htpasswd ফাইল তৈরি করতে হবে। এবং তারপর আপনাকে আপনার ওয়েবসাইটের .htaccess ফাইলটিকে .htpasswd ফাইলের অবস্থান সম্পর্কে জানাতে হবে। এবং এটি আপনার লগইন পৃষ্ঠাটি লক করে দেবে।

কিভাবে একটি .htpasswd ফাইল তৈরি করবেন?

এই নির্দিষ্ট ফাইলটিতে, আপনি লগইন পৃষ্ঠায় যাদের অ্যাক্সেস করতে চান তাদের ব্যবহারকারীর নাম এবং পাসওয়ার্ড সংরক্ষণ করবেন। মূলত এটি আপনার বাড়ির চারপাশে বেড়ার গেট থাকার মতো। আপনি আপনার সাইটের অ্যাক্সেস পেতে চান এমন ব্যক্তিদেরই আপনি গেটের চাবি দিতে পারেন৷৷ আসুন জেনে নেই কিভাবে আপনি একটি .htpasswd ফাইল তৈরি করতে পারেন।

একটি নতুন .htpasswd ফাইল তৈরি করতে, আপনাকে একটি .htpasswd কমান্ড লাইন টুল ব্যবহার করতে হবে। অনলাইনে বেশ কিছু টুল পাওয়া যায়। আপনি যখন ব্যবহার করতে চান এমন একটি খুঁজে পান, এটি খুলুন এবং কমান্ড লাইনে, নিম্নলিখিত কোডটি লিখুন:

htpasswd -c .htpasswd হরিণী

এই কমান্ড লাইনে, c হল create এবং harini হল ব্যবহারকারীর নাম যা আমরা বেছে নিই। এই কোডটি টাইপ করার পরে, আপনি যখন এন্টার চাপবেন, তখন আপনাকে একটি পাসওয়ার্ড তৈরি করতে বলা হবে যা এই ব্যবহারকারীর নামের জন্য অনন্য হবে। চিন্তা করবেন না; আপনার পাসওয়ার্ড এনক্রিপ্ট করা হবে।

How to Protect Login page with HTTP প্রমাণীকরণ?

কিন্তু আপনার যদি ইতিমধ্যেই একটি .htpasswd ফাইল থাকে, তাহলে আপনাকে যা করতে হবে তা হল একটি নতুন ব্যবহারকারীর নাম এবং পাসওয়ার্ড যোগ করুন৷ আপনি নিম্নলিখিত কমান্ড লাইনটি লিখে এটি করতে পারেন:

htpasswd .htpasswd রাহুল

লক্ষ্য করুন কিভাবে আমরা এখানে -c ব্যবহার করিনি কারণ আমরা একটি নতুন ফাইল তৈরি করছি না।

How to Protect Login page with HTTP প্রমাণীকরণ?

সাধারণত একটি .htpasswd ফাইল দেখতে এরকম কিছু হবে:username:encrypted_password. So if the username is harini and the password is dummy123pass, then the .htaccess file would be:harini:$apr1$50r17zis$lNbFJs4rQFfkp4ToO2/ZS/

The password has been encrypted. This .htaccess file is essentially your HTTP Basic Authentication credentials.

In case, you don’t want to use a tool or don’t know how to; you can use a .htpasswd generator. Open this link, and you should be able to see a window like an image below.

How to Protect Login page with HTTP প্রমাণীকরণ?

Type the username and password of your choice. There is an option to generate a random password too. Once done, hit the button that says Generate .htpasswd file. You should be able to see an output.

Modifying the .htaccess File

The .htaccess file is one of the most important files of your WordPress site. There are two things we’ll do with your .htaccess file. One, we’ll tell it what it needs to restrict and two, we tell it from where it could get the HTTP Basic Authentication credentials we just created in the steps above.

.htaccess is present in the public_html folder. To access it you will have to visit your web host account. Log in to your web host and go to a page called cPanel. There you should be able to find an option for File Manager. Select that, and a page will open, and in that page, you should be able to view the file.

How to Protect Login page with HTTP প্রমাণীকরণ?

Sometimes .htaccess is hidden and may not appear in the public_html folder. When that’s the case, what you need to do is go back to the cPanel, and click on File Manager. A popup will appear where you’ll have to select ‘Show Hidden Files.’

How to Protect Login page with HTTP প্রমাণীকরণ?

Next, you need download the file and then open it to add this code of line:

<Files wp-login.php>

AuthUserFile /path/to/.htpasswd

AuthName "Private access"

AuthType Basic

require valid-user

</Files>

A few things you need to keep in mind when inserting this code: AuthUserFile /path/to/.htpasswd – is the path to the .htpasswd file you just created. Make sure the path is correct. The term ‘valid-user’ tells the system any user who has been mentioned in the .htpasswd file with access to the login page. But if you want to be selective about who you grant access to, then instead of using ‘valid-user’, you can just mention the usernames.

After you are done, save it and upload it to the same place from where you downloaded it. And that’s it. The next time you try to access the login page, you’ll see a small window appearing asking you for specific login credentials.

Besides HTTPS authentication, we suggest that you also implement two-factor authentication, which will add another layer of security to your WordPress login page.

Also take a few more security measures like moving your site from HTTP to HTTPS, installing a security plugin, protecting the login page, etc. While protecting your login page is a great idea, there are other ways in which hackers can gain access to your website. We strongly suggest that you take a more holistic approach to security by following our guide on Complete WordPress Security.


  1. Windows 10

  2. আমি কিভাবে পাসওয়ার্ড ম্যানেজার দিয়ে আমার ম্যাক রক্ষা করতে পারি

  3. কিভাবে পাসওয়ার্ড দিয়ে আপনার USB পেন ড্রাইভ রক্ষা করবেন

  4. কিভাবে এক্সেল ফাইলকে পাসওয়ার্ড সুরক্ষিত করবেন