Ssh - Terminal
- Theory
- Secure Shell
- Communication Protocol (Like http, https, ftp)
- SSH is the client, SSHD is the server
- Authentication Methods =>
ssh hostName@IPAddress
- Password
- Public/Private Key Pair
- Host Based
- Generating Keys
ssh-keygen
- Private Key will be at "~/.ssh/id_rsa"
- Public Key will be at "~/.ssh/id_rsa.pub"
- Public Keys goes into Server "authorized_keys" file
- Putty & Git Bash like Terminals can be used
cat .ssh/id_rsa.pub
=> Show public key
cat ~/.ssh/id_rsa.pub | ssh hostName@IPAddress "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys"
=> Add Key to server in one command
hostName@IPAddress
=> Connect without Password
cat .ssh/authorized_keys
=> Key should display
touch test.txt
=> Create a file
scp ~/test.txt hostName@IPAddress:~
=> Copy a file to the server using SCP
- GitHub
ssh-keygen -t rsa
ssh-add /home/brad/.ssh/id_rsa_github
eval ssh-agent -s
- Clone repo
- Install Node
npm install
$ npm start
- Build Out React App
npm run build
sudo mv -v /home/brad/react_otka_auth/build/* /var/www/html
=> Move static build to web server root