SHARE
TWEET

Untitled

a guest Jan 24th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # sudo
  2. 用 root 登入
  3. apt-get install sudo
  4. usermod -a -G sudo tom # 給予 tom sudo 權限
  5.  
  6. # ssh 登入不用密碼
  7. 用 sftp 上傳 ~/.ssh/id_rsa.pub 到 vm 的 /home/tom
  8. 登出,用 tom 登入
  9. mkdir ~/.ssh
  10. touch ~/.ssh/authorized_keys
  11. cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
  12. chown -R tom:tom ~/.ssh
  13. chmod 700 ~/.ssh
  14. chmod 600 ~/.ssh/authorized_keys
  15. rm id_rsa.pub
  16. 設定 port forward 2222 -> 22
  17. 在 vm 外面把 ssh -p 2222 tom@127.0.0.1 存到 ssh2debian.sh
  18. chmod +x ssh2debian.sh
  19. ./ssh2debian.sh
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top