How to configure SSH without a password with a key pair in Ubuntu

Create a key pair, leave all values by default:

ssh-keygen

In the console, enter a command that configures the server so that you can sign in with an SSH key:

 ssh-copy-id -i .ssh/id_rsa.pub [email protected] 

Instead of127.0.0.1, specify the IP server.

Take the private key id_rsa rename the extension in PPK, winscp add to the connection SSH authentication and it will offer to convert the file to Putty format and save a new key. and add a new key to the connection, try to connect.

Edit the Sshd_config file

mcedit /etc/ssh/sshd_config

Add the PasswordAuthentication no instruction

Immediately you can change the standard access port, the Port 22  instruction, for example, write Port 4321, now access to SSH will be on port 4321.

Reboot ssh to apply config changes:

systemctl restart ssh

Now when you try to log in by password, we get a window with an error:

Attach a private key to the connection and the task is solved.

Intercept require output in PHP or execute PHP in file_get_contents

… So we’re introducing a plan-intercept. Only immediately prepare a report that the plan-interception no results.
The Lord of the Rings: the Two Towers

In order to load the contents of a file and display it in a certain place of a Web page, you can use file_get_contents, but if the file loaded in this way will contain PHP code, it is not processed.
For the PHP code to execute in a dynamically loaded file, you can use the command require, but it outputs the result instantly, and if we pre-generate the output into a variable, this method is also not suitable… Or does it fit?

In PHP there is a set of commands to buffer output to enable the output buffer by using the ob_start() command. After that, we call require and collect the result in the variable with the command ob_get_clean();

function GetPHP($file_name){
    ob_start();
    require( $file_name );
    return ob_get_clean();
}

Here is a function that returns the result of executing a PHP script in a variable.

echo GetPHP('some-file.php');