Linux系統下通過SSH遠程登錄服務器的方法
1.首先在服務器上安裝ssh的服務器端
sudo apt-get install openssh-server
sudo apt-get install openssh-client
2.啟動ssh-server。
/etc/init.d/ssh restart
3.確認ssh-server已經正常工作。
netstat -tlp
tcp6 0 0 *:ssh : LISTEN -
看到上面這一行輸出說明ssh-server已經在運行了。
4.通過ssh登錄服務器。
執行ssh的shell命令如下:
ssh -l [用戶名] [IP地址]
通過上面可知,若登錄服務器的IP地址和用戶密碼,
這里假設服務器的IP地址為192.168.1.1,登錄名稱為admin,密碼為123456。
ssh -l admin 192.168.1.1
接下來會提示輸入密碼:
admin@192.168.1.1's password:
然后就能成功登錄到服務器上了。
出現下面的信息,則說明成功進入服務器。
Welcome to Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-170-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Pure upstream Kubernetes 1.21, smallest, simplest cluster ops!
https://microk8s.io/
Welcome to Alibaba Cloud Elastic Compute Service !
Last login: Sun May 9 16:31:38 2021 from 117.28.155.17
說明:
-
Welcome to Ubuntu 16.04.7 LTS
,說明服務器系統使用的是Ubuntu 16.04系統。 -
Welcome to Alibaba Cloud Elastic Compute Service !
,這里用的阿里雲服務器。 -
Last login: Sun May 9 16:31:38 2021 from 117.28.155.17
,這里顯示的是最后一次登錄的相關信息,登錄的時間以登錄的ip地址。
5.進入雲服務器后即可按照Linux系統的命令來進行操作
