是在ubuntu下出現的需求 現筆記記錄
apt-get update
更新源命令
apt-get install openssh-server
安裝ssh服務
容易出現無法定位軟件包。出現此問題是因為軟件源沒有更新 可以嘗試更新命令一試。或編輯etc/apt/source.list或sources.list ,添加源地址
如:
阿里雲Ubuntu 18.04源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
還可以百度一下,查找源
然后apt-get update
更新
ps -e | grep ssh
檢測ssh服務是否啟動
看到有ssh字樣就是啟動了
如未啟動就要手動啟動服務
/etc/init.d/ssh start
直接find查找ssh找到路徑,或到etc下手動搜索
配置ssh-server,配置文件位於/etc/ssh/sshd_config,默認端口為22,為了安全,一般自定義為其他端口,然后重啟
/etc/init.d/ssh resart
然后用xshll或putty連接