Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server ip: server-ip
- password: password
- user: root
- using SSh
- command:
- -> ssh root@server-ip
- then it will asked for password like bellow
- root@server-ip's password:
- write password and press enter
- Now you are in your vps server
- In this approach, every command ask password in every time.
- If we want to avoid to enter password in every time,
- then we need to go two approach
- 1. generate private key
- 2. authorize public key
- let look at 2nd options:
- For this need to find local pc's public key:
- -> ls ./.ssh/
- above command will show public key if it exists
- id_rsa id_rsa.pub known_hosts
- Then copy the public key file to vps server
- -> scp ./.ssh/id_rsa.pub root@107.191.96.40:~/delwar_rsa.pub
- then it will asked for password like bellow
- root@server-ip's password:
- write password and press enter
- After that login using SSh
- command:
- -> ssh root@server-ip
- then it will asked for password like bellow
- root@server-ip's password:
- White password and press enter
- Then the last command is
- -> cat delwar_rsa.pub >> .ssh/authorized_keys
- above command will append local public key to authorized_keys.
- Now All is set. Done .
- Now when you connect to your vps using
- -> ssh root@107.191.96.40
- It will never ask you password every time.
- Yahhhhhhh.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement