debian配置ssh密碼連接是真的坑,網上大多都不全,找起來很麻煩,這里記錄一下。
修改root密碼
sudo passwd root
su root
然后修改 vi /etc/ssh/sshd_config文件內容 具體參考
1、查看是否安裝 openssh-server,執行命令:yum list installed | grep openssh-server
如果有openssh-server,則是已安裝,如果沒有則需要安裝,執行安裝命令:yum install openssh-server
2、打開sshd配置文件sshd_config ,執行命令:vi /etc/ssh/sshd_config
去掉監聽端口、地址前的注釋:
3、開啟遠程登錄:
4、開啟用戶密碼作為連接驗證,保存退出
引用該鏈接:https://www.pianshen.com/article/80791885627/
最后用 下面這個命令重啟服務
systemctl restart ssh
寶塔重啟ssh
/etc/init.d/bt restart
順帶提一下
想kill -9 pid 殺對應端口進程
查看對應端口進程的ID命令參數
netstat -nltp|grep 22