ssh
rsync
REMOTE_MACHINE_ALIAS
— SSH alias for remote machine. Something likeblood-dragon
orsonic
.REMOTE_MACHINE_IP_OR_HOSTNAME
— remote machine IP or hostname. Something like42.42.42.42
orremote.domain.com
.REMOTE_MACHINE_USERNAME
— your remote machine user. Something likejohn_doe
.
- Generate SSH key.
$ ssh-keygen -t rsa -b 4096 -C "{REMOTE_MACHINE_USERNAME}"
- Append the following content to
~/.ssh/config
.
Host {REMOTE_MACHINE_ALIAS}
User {REMOTE_MACHINE_USERNAME}
HostName {REMOTE_MACHINE_IP_OR_HOSTNAME}
Port 22
IdentityFile ~/.ssh/{SSH_KEY_NAME}
PreferredAuthentications publickey
ControlMaster auto
ControlPath /tmp/%r@%h:%p
ControlPersist 1h
ControlMaster
enables SSH connection reusage.ControlPersist
specifies for how long SSH should keep connection open.
- Copy and send public key to a person responsible for remote machine maintenance.
# macOS-specific. Linux users, you know what to do.
$ pbcopy < ~/.ssh/{SSH_KEY_NAME}.pub
- Once you’ve received confirmation that remote machine is ready for you, try the connection.
$ ssh {REMOTE_MACHINE_ALIAS}
- Download latest release version of
mainframer.sh
and save it in your project. Most likely commit it to version control system so you could sync changes across all team members.
We recommend you to subscribe to changes in this repo (follow it on GitHub / watch for tweets of its maintainers / etc). This will allow you to apply best practises we found to make mainframer
faster and safer.
-
Carefully read Options documentation and configure mainframer for your kind of project.
-
Finally you can test the build.
$ bash mainframer.sh echo "It works!" > success.txt