Linux安裝和配置ssh

1.安裝openssh-server

# yum install -y openssl openssh-server

 

2.修改配置文件

a、用 vi 打開配置文件 /etc/ssh/sshd_config

b、將紅色框的#去掉

查看
# rpm -qa | grep openssh-server

3.啓動ssh的服務

# systemctl start sshd.service

 

4.設置開機自動啓動ssh服務

# systemctl enable sshd.service

 

5.設置文件夾~/.ssh的訪問權限

(網絡虛擬服務器可能沒有這個文件夾,ssh登錄需要諮詢提供商)

6.重啓sshd

# /usr/sbin/sshd -t
# systemctl status sshd

 

附加:修改ssh登錄端口

# vi /etc/ssh/sshd_config

 

 

重啓服務
# /etc/init.d/sshd restart

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章