apache_conf Linux片段

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf Linux片段相关的知识,希望对你有一定的参考价值。

# Linux Config Snippets

- [Bash Customization](#Bash-Customization)
  * [Case Insensitive Tab Completion](#Case-Insensitive-Tab-Completion)
- [SSH](#SSH)
  * [Setup Remote Access by SSH Key](#Setup-Remote-Access-by-SSH-Key)

## Bash Customization

### Case Insensitive Tab Completion
```sh
echo "set completion-ignore-case on" >> ~/.inputrc
source ~/.bashrc
```

---

## SSH

### Setup Remote Access by SSH Key
1. Create RSA Key Pair
    ```sh
    ssh-keygen
    ```
    > NOTE: If an SSH key already exists you will be prompted to overwrite it - Don't do it
  
1. Copy the Public Key to the Server
    Using the `ssh-copy-id` command if it's available
    ```sh
    ssh-copy-id username@remote_host
    ```
    
    If the `ssh-copy-id` command isn't available this is an alternative
    ```sh
    cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
    ```
    
1. Authenticate to the Server Using SSH Keys
    ```sh
    ssh username@remote_host
    ```
    
1. Disable Password Authentication on the Server (Optional)
    Edit the `/etc/ssh/sshd_config` file and Add the following line (or update it if it exists)
    ```
    ...
    PasswordAuthentication no
    ...
    ```
    
    Save the file and restart the `ssh` service by running 
    ```sh
    sudo systemctl restart ssh
    ```
    
    > Before closing the terminal check that you are able to login from another terminal to avoid getting locked out

以上是关于apache_conf Linux片段的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf 强大的.htaccess片段,需要在最顶层使用RewriteEngine On

apache_conf [lib config] #linux

apache_conf [linux:.htaccess] apache的htaccess说明。 #linux #apache

apache_conf Linux + Visual Studio Code + Docker

apache_conf Configuraçãoninicial做Linux Debian

text Debian linux片段