Skip to content

Instantly share code, notes, and snippets.

@patorn
Forked from learncodeacademy/deployUser.md
Last active November 20, 2018 13:59
Show Gist options
  • Select an option

  • Save patorn/35a7ee21f976e7763d696f19b6cd843c to your computer and use it in GitHub Desktop.

Select an option

Save patorn/35a7ee21f976e7763d696f19b6cd843c to your computer and use it in GitHub Desktop.

Revisions

  1. patorn revised this gist Nov 20, 2018. 1 changed file with 5 additions and 17 deletions.
    22 changes: 5 additions & 17 deletions deployUser.md
    Original file line number Diff line number Diff line change
    @@ -2,26 +2,14 @@

    Login to new server as root, then add a deploy user
    ```bash
    sudo useradd --create-home -s /bin/bash deploy
    sudo adduser deploy sudo
    sudo passwd deploy
    sudo useradd --create-home -s /bin/bash deployer
    sudo adduser deployer sudo
    sudo passwd deployer
    ```
    And Update the new password


    Now login as that user
    ```bash
    ssh [email protected]
    ```

    Make directory .ssh on the remote server and log out
    ```bash
    mkdir .ssh
    exit
    ```

    Push your ssh key to the authorized_keys file on the remote server
    Copy root ssh to deployer
    ```bash
    scp ~/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys
    rsync --archive --chown=deployer:deployer ~/.ssh /home/deployer
    ```

  2. @learncodeacademy learncodeacademy revised this gist Oct 15, 2014. 1 changed file with 2 additions and 6 deletions.
    8 changes: 2 additions & 6 deletions deployUser.md
    Original file line number Diff line number Diff line change
    @@ -2,16 +2,12 @@

    Login to new server as root, then add a deploy user
    ```bash
    sudo useradd --create-home deploy
    sudo useradd --create-home -s /bin/bash deploy
    sudo adduser deploy sudo
    sudo passwd deploy
    ```
    And Update the new password

    Update the password, then
    Change the new users default to bash by adding `/bin/bash` to the end of the last line of `/etc/passwd`
    ```bash
    sudo vim /etc/passwd
    ```

    Now login as that user
    ```bash
  3. @learncodeacademy learncodeacademy revised this gist Oct 15, 2014. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions deployUser.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    (wherever it says url.com, use your server's domain or IP)

    Login to new server as root, then add a deploy user
    ```bash
    sudo useradd --create-home deploy
    @@ -16,13 +18,13 @@ Now login as that user
    ssh [email protected]
    ```

    Make directory .ssh on the remote server
    Make directory .ssh on the remote server and log out
    ```bash
    mkdir .ssh
    exit
    ```

    And add your ssh key to authorized keys
    Push your ssh key to the authorized_keys file on the remote server
    ```bash
    scp ~/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys
    ```
  4. @learncodeacademy learncodeacademy created this gist Oct 10, 2014.
    29 changes: 29 additions & 0 deletions deployUser.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    Login to new server as root, then add a deploy user
    ```bash
    sudo useradd --create-home deploy
    sudo adduser deploy sudo
    sudo passwd deploy
    ```

    Update the password, then
    Change the new users default to bash by adding `/bin/bash` to the end of the last line of `/etc/passwd`
    ```bash
    sudo vim /etc/passwd
    ```

    Now login as that user
    ```bash
    ssh [email protected]
    ```

    Make directory .ssh on the remote server
    ```bash
    mkdir .ssh
    exit
    ```

    And add your ssh key to authorized keys
    ```bash
    scp ~/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys
    ```