python_note
  • Introduction
  • My Python
    • Anaconda
    • argparse
    • datetime
    • json
    • logging
    • numpy
    • open
    • openCC
    • pandas & csv
    • Socket & SocketServer
    • re
    • yaml
    • smtp
    • 物件操作
    • unittest
    • 線程
    • prettytable
    • IO
    • pycurl
    • sys
    • pickle
    • auto-python-to-exe
    • cython
    • nuitka
  • Crawler
    • Urllib & Requests
      • User-agent
      • Percent-Encoding
      • mail code
    • Selenium
    • TCP & UDP
    • 控制字符(control character)
  • Web Development
    • Flask
      • RESTful api
      • Template
      • blueprint
    • Django
      • 環境佈署(windows)
    • 檢查Port
    • Apache
    • 使用者行為
    • jQuery
    • 壓力測試
    • DataTable
    • Bootstrap
    • CSS
    • JavaScript
    • Chart.js
  • Deep Learning
    • Keras 設定
    • RNN
    • LSTM
  • Test
    • T-Test
  • 資料結構
    • Hash
    • 時間複雜度
  • NLP
    • N-gram
    • CKIP
    • 中文轉數字
    • CRF
    • Mutual Information
    • 模糊比對
  • Linebot
    • Heroku
    • 圖文選單
    • channel
  • Linux
    • 常用指令
    • shell script
    • sshfs
    • ssh
    • nodejs & npm
    • debug
  • GCP
    • app engine
    • ssh(gcp)
    • gsutil
    • brabrabra
    • Load Balancer
    • k8s
  • Database
    • mysql
    • elasticsearch
      • Query
      • Backup and Restore
      • elasticdump
      • es2csv
      • ELK
    • mongodb
      • install
      • authentication
      • pymongo
    • sql server
  • go
    • Swarm
  • Docker
    • Kitematic
    • Dockerfile
    • Swarm
  • Git
  • 其他
    • USB軟體保護
    • Windows效能監視器
  • Blockchain
Powered by GitBook
On this page

Was this helpful?

  1. Linux

ssh

ssh服務狀態

# 查看ssh服務是否有啟動
netstat -a | grep ssh

# 如果有啟動,顯示資訊如下
tcp 0 0 *:ssh *:* LISTEN

建立連線

# 先設定ssh key  (參考連結)

測試

# 設定完成後即可使用 ssh 進行連線
ssh -i [key] [username]@[ip]

# 但沒了就無法連線, 會出現Permission denied
ssh [username]@[ip]

# 需要再到目標vm中更改ssh設定
sudo vim /etc/ssh/sshd_config

# 將PasswordAuthentication改為yes
PasswordAuthentication yes

# 儲存後再重啟ssh服務
sudo service sshd restart

# 如果不知道自己使用者的密碼可以自行修改
sudo passwd [username]

# 之後就可以甭key進行ssh連線惹!!!
ssh [username]@[ipß]
PrevioussshfsNextnodejs & npm

Last updated 5 years ago

Was this helpful?

參考連結: 這篇真ㄉ不錯 gcp上ssh的設定

https://mini.nidbox.com/diary/read/8884523
https://magiclen.org/linux-ssh/
https://hk.saowen.com/a/9cc212f4652503c0581de12e8f986a212fa4995774f96c124fb87c25f12c575e
https://cloud.google.com/compute/docs/instances/connecting-to-instance#standardssh