Ubuntu開啟SSH服務

2021-05-28 01:16:50 字數 1019 閱讀 8743

ssh分客戶端openssh-client和openssh-server 

如果你只是想登陸別的機器的ssh只需要安裝openssh-client(ubuntu有預設安裝,如果沒有則sudo apt-get install openssh-client),如果要使本機開放ssh服務就需要安裝openssh-server 

sudo apt-get install openssh-server 

然後確認sshserver是否啟動了: 

ps -e |grep ssh 

如果看到sshd那說明ssh-server已經啟動了。 

如果沒有則可以這樣啟動:sudo /etc/init.d/ssh start 

ssh-server配置檔案位於/ etc/ssh/sshd_config,在這裡可以定義ssh的服務埠,預設埠是22,你可以自己定義成其他埠號,如222。 

然後重啟ssh服務: 

sudo /etc/init.d/ssh stop 

sudo /etc/init.d/ssh start 

然後使用以下方式登陸ssh: 

ssh [email protected] tuns為192.168.0.100機器上的使用者,需要輸入密碼。 

斷開連線:exit

ubuntu 系統在安裝時如果沒有配置ip你只要開啟ssh後配置乙個ip及閘道器就可以遠端操作了。

一、ifconfig eth0(網絡卡名稱) 10.0.0.5(ip位址) netmask 255.255.255.0(掩碼)

二、route add default gw 10.0.0.1(閘道器)

三、開啟ssh

檢視是否有/etc/ssh/sshd_config檔案

1、cat /etc/ssh/sshd_config

如果有則:

2、/etc/init.d/ssh restart

沒有這個檔案則:

3、apt-get update(公升級)

4、apt-get install ssh

5、y

Ubuntu開啟ssh服務

sudo apt get install openssh server sudo apt get install openssh client 然後確認sshserver是否啟動了 ps e grep ssh 如果只有ssh agent那ssh server還沒有啟動,需要 etc init.d s...

ubuntu開啟SSH服務

ssh分客戶端openssh client和openssh server 如果你只是想登陸別的機器的ssh只需要安裝openssh client ubuntu有預設安裝,如果沒有則sudo apt get install openssh client 如果要使本機開放ssh服務就需要安裝openss...

Ubuntu開啟ssh服務

網上有很多介紹在ubuntu下開啟ssh服務的文章,但大多數介紹的方法測試後都不太理想,均不能實現遠端登入到ubuntu上,最後分析原因是都沒有真正開啟ssh server服務。最終成功的方法如下 sudo apt get install openssh server ubuntu預設安裝了open...