---
# System prepended metadata

title: Untitled

---

## 1. Create remote ssh alias

```vim ~/.ssh/config```

alias : `nextschoolTrue`
public key : `~/.ssh/id_rsa_true`

```
Host nextschool
  HostName vm.nextgensoft.biz
  PreferredAuthentications publickey
  User sc
  IdentityFile ~/.ssh/id_rsa_ns

Host nextschoolTrue
  HostName 61.91.15.30
  PreferredAuthentications publickey
  User nextension
  IdentityFile ~/.ssh/id_rsa_true
```

reload local shell
```
 source ~/.zshrc
 ```


Test remote ssh with key

```
ssh nextschoolTrue
```

you will see report prompt

```
Last login: Wed Sep  2 06:33:27 2020 from 184.22.199.53
nextension@true-nextension:~$
````


## 2. Create remote git

cd to working directory eg. ```/Users/pangpond/Sites/Nextgensoft/NextSchool```

```
cd /Users/pangpond/Sites/Nextgensoft/NextSchool
vim .git/config
```

remotename : ```backup```

```
...
[remote "production"]
	url = ssh://sc@nextschool/home/sc/repos/nextschool.git
	fetch = +refs/heads/*:refs/remotes/production/*
[remote "backup"]
	url = ssh://nextension@nextschoolTrue/home/nextension/repos/nextschool.git
	fetch = +refs/heads/*:refs/remotes/backup/*
```


push to 3 location

```
❯ git push origin develop && git push production develop:master && git push backup develop:master
```