Computer >> 컴퓨터 >  >> 프로그램 작성 >> HTML

WordPress 관리 디렉토리에 대한 액세스를 제한하는 방법은 무엇입니까?

WordPress는 현재 6천만 개 이상의 웹사이트를 운영하고 있어 가장 인기 있는 CMS입니다. 인기가 좋든 나쁘든 관심을 끌기 때문에 WordPress 사이트는 하루 1분마다 90000번의 해킹 시도를 경험하는 경향이 있습니다. 사이트 보안과 관련하여 유감스럽게도 모든 면에서 보안을 제공하는 확실한 방법은 없습니다. 오히려 많은 일을 해야 하고 다양한 글꼴로 보안을 구현하여 사이트가 해커로부터 안전한지 확인해야 합니다. 다른 보호 계층을 추가하는 프로세스를 계층 방어라고 합니다. 앞서 우리는 강력한 사용자 이름과 비밀번호를 사용하는 HTTP 인증, 이중 인증 사용과 같은 보호 조치에 대해 이야기했습니다. 오늘 우리는 WordPress 관리자 디렉토리에 대한 액세스를 제한하는 또 다른 보호 방법을 배우고 있습니다.

WordPress 관리 디렉토리는 핵심 WordPress 파일이 있는 위치입니다. 여기에 있는 파일을 사용하면 귀하와 같은 사용자가 다양한 관리 기능을 실행할 수 있습니다. 예를 들어, 대시보드에 로그인하려고 할 때 WordPress는 사용자가 제공한 자격 증명이 올바른지 또는 사용자가 관리자인지 또는 사이트에 대한 액세스가 제한된 단순 기여자인지 확인합니다. wp-admin 폴더의 파일은 WordPress가 이러한 기능을 수행할 수 있도록 합니다.

해커가 귀하의 사이트에 액세스하면 자신의 동기를 강화하기 위해 파일을 수정할 수 있습니다. 그들은 누가 사이트에 액세스할 수 있고 누가 액세스하지 않는지 지시하기 시작할 수 있습니다. 관리자와 웹 사이트 소유자를 차단할 가능성이 있습니다. 자신의 사이트에 액세스하지 못할 수 있습니다. 그렇기 때문에 조기 예방이 필수입니다. WordPress 관리 디렉토리에 대한 액세스를 제한하면 해커가 귀하의 사이트를 탈취하는 것을 제한할 수 있습니다.

제한이 어떻게 작동하는지 설명하는 가장 쉬운 방법은 유추를 사용하는 것입니다. 웹 사이트가 집이고 집의 문이 WordPress 관리 디렉토리인 경우. 이제 문에 경비원을 배치하면 집이 더욱 안전하게 보호됩니다(사이트 읽기). 경비원은 모든 방문자의 (IP 주소 읽기)를 확인한 다음 집(예:웹 사이트)에 대한 액세스를 허용하거나 거부하는 책임이 있습니다. 이 게시물에서는 IP 주소를 사용하여 WordPress 관리자 디렉토리에 대한 액세스를 제한하는 방법을 보여줍니다. 이는 본질적으로 특정 불량 IP 주소만 WordPress 사이트의 관리자 디렉토리에 액세스하는 것을 차단한다는 것을 의미합니다.

시작하기 전에 IP 주소가 고정되어 있는지 확인해야 합니다. IP 주소가 확실하지 않은 경우 Google 검색을 하거나 인터넷 제공업체에 문의하는 것이 좋습니다.

WordPress 관리 디렉토리에 대한 액세스 제한:

시작하려면 먼저 파일 관리자에서 .htaccess 파일을 다운로드해야 합니다. 아래 단계를 따르십시오:

웹 호스트 계정에 로그인 cPanel이라는 페이지로 이동합니다. . 여기에서 파일 관리자 옵션을 찾을 수 있습니다. . 선택하면 다음과 같은 페이지가 열립니다.

WordPress 관리 디렉토리에 대한 액세스를 제한하는 방법은 무엇입니까?

2단계: This is a typical file manager page. On the left-hand side, there are a bunch of folders. Select public_html, and you’d see a drop-down.

WordPress 관리 디렉토리에 대한 액세스를 제한하는 방법은 무엇입니까?

Step 3: In the drop down there will a folder called wp-admin . You’ll find a .htaccess file in this folder. You’d notice that unlike other files in the directory, .htaccess has no extension like .html or .txt. or PHP.

Step 4: To download the .htaccess file all you need to do is download the file using a download button on the File Manager page. It should look something like the image below:

WordPress 관리 디렉토리에 대한 액세스를 제한하는 방법은 무엇입니까?

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’.

WordPress 관리 디렉토리에 대한 액세스를 제한하는 방법은 무엇입니까?

In case, you find out that your website does not have a .htaccess file, you’ll need to create a new one.

After you have downloaded the .htaccess file, open it. It should look something like the picture below:

WordPress 관리 디렉토리에 대한 액세스를 제한하는 방법은 무엇입니까?

Step 5: At the end of the .htaccess file, add the following code:

order deny, allow 

allow from your.IP.address 

deny from all 

참고: Place the IP address that you want to blacklist instead of ‘IP.address.1’ and ‘IP.address.2’.

Step 6: After you are done, you will need to upload the file in the public_html directory in the File Manager. There should be an Upload option in the File Manager page.

WordPress 관리 디렉토리에 대한 액세스를 제한하는 방법은 무엇입니까?

After you upload the file, the IP’s you mentioned will be blocked. When these IP addresses try to access your site, they’ll see a ‘403 Forbidden’ error on the page.

Make sure that the .htaccess file you modified was from the ‘wp-admin’ directory and not the root directory (i.e. public_html) of your WordPress. There is a .htaccess file in the root directory, and we are not making any changes in that. If by mistake, you modified the .htaccess file in the ‘wp-admin’ directory, then all visitor to your site will be blocked. You don’t want that. Therefore we’d recommend you to be very careful.

There is one issue that may crop up when you limit access to WordPress admin directory using IP. It breaks the front-end Ajax functionality. This particular functionality enables web pages to show real-time changes. For instance, you may be using a plugin that allows Twitter feed on your site. Every time you tweet something, it automatically appears on the site. You don’t need to reload the page to see the tweet. This is possible due to the Ajax functionality.

To avoid breaking the front-end Ajax functionality, you’ll need to find out if any of your plugins use Ajax in the front end. If yes, then you’ll have to add the following code to your .htaccess file from the wp-admin directory.

<Files admin-ajax.php> 

order allow, deny 

allow from all 

satisfy any </Files>

And that’s it.

Over to You

In order to limit access to WordPress admin directory, you’d have to have a bit of knowledge about WordPress files. We hope that after reading this post, your site will be a bit more secure than it was before. Please contact us if you have any queries or feedback. And thanks for reading.