顯示具有 Linux 標籤的文章。 顯示所有文章
顯示具有 Linux 標籤的文章。 顯示所有文章

2014年6月9日 星期一

[基礎知識] CenOS 6 如何開啟ssh遠端

很基礎的知識,沒有很難,網路上也查得到,但為了讓重作時快一點,就紀錄一下

CenOS 6 內建有ssh,直接啟動即可

1.su 切換成 root 權限
2.啟動 ssh service,service sshd start
3.編輯 hosts.allow或 hosts.deny,使用vim,按下 insert 進入編輯模式,編輯完畢用esc跳離
並使用「:wq」存檔後離開


設定哪些IP可使用SSH連線

/etc/hosts.allow 允許此IP使用SSH登入
/etc/hosts.deny 拒絕此IP使用SSH登入

[root@host ~]$ vim /etc/hosts.allow
/* 允許此ip使用SSH登入 */
sshd:192.168.10.130 

[root@host ~]$ vim /etc/host.deny
/* 限制IP使用SSH 連線 */
sshd:all 



鳥哥的私房菜,關於VIM

無痛教學 KiKiNote,關於SSH