RHCE课程-RH131Linux管理笔记五-Linux远程登陆telnet及ssh服务
生活随笔
收集整理的這篇文章主要介紹了
RHCE课程-RH131Linux管理笔记五-Linux远程登陆telnet及ssh服务
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
telnet相信大家都不陌生,在RHCE課程-RH131Linux管理筆記三-linux系統(tǒng)服務(wù)介紹及管理里面我們已經(jīng)配置過了,我也不多做介紹,直接說安裝吧。 使用yum安裝的前提是你已經(jīng)配置好YUM client端,具體參見RHCE課程-RH131Linux管理筆記一-RPM及其管理,YUM客戶端及服務(wù)器的配置 #yum install "telnet*" [root@rhel5 Server]#?yum install telnet*?
Loading "security" plugin?
Loading "rhnplugin" plugin?
Loading "installonlyn" plugin?
This system is not registered with RHN.?
RHN support will be disabled.?
Setting up Install Process?
Setting up repositories?
rhel-debuginfo??????????? 100% |=========================| 1.1 kB??? 00:00?????
Reading repository metadata in from local files?
primary.xml.gz??????????? 100% |=========================| 9.5 kB??? 00:00?????
################################################## 31/31?
Parsing package install arguments?
Examining telnet-0.17-38.el5.i386.rpm: telnet - 1:0.17-38.el5.i386?
telnet-0.17-38.el5.i386.rpm: does not update installed package.?
Examining telnet-server-0.17-38.el5.i386.rpm: telnet-server - 1:0.17-38.el5.i386?
Marking telnet-server-0.17-38.el5.i386.rpm to be installed?
Resolving Dependencies?
---> Populating transaction set with selected packages. Please wait.?
---> Package telnet-server.i386 1:0.17-38.el5 set to be updated?
---> Running transaction check?
---> Processing Dependency: xinetd for package: telnet-server?
---> Finished Dependency Resolution?
Error: Missing Dependency: xinetd is needed by package telnet-server?
[root@rhel5 Server]#?yum install xinetd?
Loading "security" plugin?
Loading "rhnplugin" plugin?
Loading "installonlyn" plugin?
This system is not registered with RHN.?
RHN support will be disabled.?
Setting up Install Process?
Setting up repositories?
Reading repository metadata in from local files?
Parsing package install arguments?
No Match for argument: xinetd?
Nothing to do?
[root@rhel5 Server]# ls |grep xinetd?
xinetd-2.3.14-10.el5.i386.rpm?
[root@rhel5 Server]#?rpm -ivh xinetd-2.3.14-10.el5.i386.rpm?
Preparing...??????????????? ########################################### [100%]?
?? 1:xinetd???????????????? ########################################### [100%]?
[root@rhel5 Server]# yum install telnet*?
Loading "security" plugin?
Loading "rhnplugin" plugin?
Loading "installonlyn" plugin?
This system is not registered with RHN.?
RHN support will be disabled.?
Setting up Install Process?
Setting up repositories?
Reading repository metadata in from local files?
Parsing package install arguments?
Examining telnet-0.17-38.el5.i386.rpm: telnet - 1:0.17-38.el5.i386?
telnet-0.17-38.el5.i386.rpm: does not update installed package.?
Examining telnet-server-0.17-38.el5.i386.rpm: telnet-server - 1:0.17-38.el5.i386?
Marking telnet-server-0.17-38.el5.i386.rpm to be installed?
Resolving Dependencies?
---> Populating transaction set with selected packages. Please wait.?
---> Package telnet-server.i386 1:0.17-38.el5 set to be updated?
---> Running transaction check Dependencies Resolved =============================================================================?
Package???????????????? Arch?????? Version????????? Repository??????? Size?
=============================================================================?
Installing:?
telnet-server?????????? i386?????? 1:0.17-38.el5??? telnet-server-0.17-38.el5.i386.rpm?? 49 k Transaction Summary?
=============================================================================?
Install????? 1 Package(s)?????????
Update?????? 0 Package(s)?????????
Remove?????? 0 Package(s)???????? Total download size: 49 k?
Is this ok [y/N]:?y ? y,就開始安裝了 Downloading Packages:?
Running Transaction Test?
Finished Transaction Test?
Transaction Test Succeeded?
Running Transaction?
? Installing: telnet-server??????????????? ######################### [1/1] Installed: telnet-server.i386 1:0.17-38.el5?
Complete!?
[root@rhel5 Server]# 現(xiàn)在這個目錄里就有telnet這個文件了,我們來看看這個文件 修改配置文件開啟telnet #vim /etc/xinetd.d/telnet 將文件最后disable =yes中的yes改成no,然后保存退出。 disable 是控制語句,為yes就是不啟動telnet,我們把他改成no 保存退出。 安裝好以后啟動服務(wù)了,這個就要借助我們系統(tǒng)服務(wù)方面的知識了。telnet是基于xinetd的服務(wù),所以我要先在配置文件中將服務(wù)開啟,然后在重新啟動xinetd服務(wù)。 然后重新啟動xinetd的服務(wù):service xinetd restart? OK,由于xinetd服務(wù)是基于System V的服務(wù),所以我們可以這樣重新啟動 記住,修改了XINETD服務(wù)的時候,要重新啟動xinetd才能生效 這樣我們的telnet服務(wù)器就開啟了,你可以在xp里面試試看能不能登陸,如果不行,我們就還需要一個設(shè)置,在/etc/hosts 文件中加入服務(wù)器和client的正向解析,域名可以亂取,只要IP地址對應(yīng)就OK了。 修改/etc/hosts?
然后我們用XP進(jìn)行測試哈~:telnet 192.168.0.188 登錄失敗哈~~ 請大家注意:root是不可以通過telnet登陸的,我們可以使用普通用戶登錄,然后使用su命令到超級用戶哈,還有就是telnet是明文傳輸,一點都不安全哈,建議只在測試時候使用telnet。 測試成功哈~~~ ############################################################################# 下面我們介紹另一個遠(yuǎn)程控制軟件ssh,安全的shell。使用22號端口,支持加密。用于替代明文傳輸?shù)膖elnet,還支持遠(yuǎn)端文件交換。 配置ssh服務(wù)器 1、安裝sshd:yum install sshd* 一般SSH是在我們安裝RHEL5系統(tǒng)時已經(jīng)默認(rèn)安裝了 2、重新啟動sshd服務(wù):service sshd restart 安裝以后直接重新啟動服務(wù)就OK了,現(xiàn)在ssh服務(wù)器就OK了哈 3、使用putty工具軟件進(jìn)行連接 我使用的是putty.exe這個軟件,是免費的。很好用,putty是不需要安裝的,這就是他滴好處哈~ 在host name填入ssh服務(wù)器的IP地址 然后點open,開始連接,下面是SSH服務(wù)器給你的rsa key,點是,同意安裝密匙。 然后登陸。 接下來還就個常用命令,需要在Linux做為Client才好實現(xiàn),我給大家用另一個Linux做為Client演示下。 scp :基于SSH的安全遠(yuǎn)端拷貝文件與目錄 scp命令語法: 1、將本地文件拷貝到遠(yuǎn)端 scp 文件 用戶@ 主機名:遠(yuǎn)端目錄 2、講遠(yuǎn)端目錄拷貝到本地 scp -r? 用戶@主機名:遠(yuǎn)端目錄?? 本地目錄 1、將本地的install.log 拷貝到服務(wù)器的/home/michael目錄 scp install.log?michael@192.168.0.188:/home/michael 我們驗證下哈~確實已經(jīng)上傳到RHEL5服務(wù)器的/home/michael/目錄下了哈~ 我們準(zhǔn)備下一個試驗的文件51cto.tar哈~ 2、將遠(yuǎn)端目錄/home/michael/51cto.tar拷貝到本地/tmp scp -r?michael@192.168.0.188:/home/michael/51cto.tar?/tmp/
本文轉(zhuǎn)自redking51CTO博客,原文鏈接:http://blog.51cto.com/redking/121742,如需轉(zhuǎn)載請自行聯(lián)系原作者
Loading "security" plugin?
Loading "rhnplugin" plugin?
Loading "installonlyn" plugin?
This system is not registered with RHN.?
RHN support will be disabled.?
Setting up Install Process?
Setting up repositories?
rhel-debuginfo??????????? 100% |=========================| 1.1 kB??? 00:00?????
Reading repository metadata in from local files?
primary.xml.gz??????????? 100% |=========================| 9.5 kB??? 00:00?????
################################################## 31/31?
Parsing package install arguments?
Examining telnet-0.17-38.el5.i386.rpm: telnet - 1:0.17-38.el5.i386?
telnet-0.17-38.el5.i386.rpm: does not update installed package.?
Examining telnet-server-0.17-38.el5.i386.rpm: telnet-server - 1:0.17-38.el5.i386?
Marking telnet-server-0.17-38.el5.i386.rpm to be installed?
Resolving Dependencies?
---> Populating transaction set with selected packages. Please wait.?
---> Package telnet-server.i386 1:0.17-38.el5 set to be updated?
---> Running transaction check?
---> Processing Dependency: xinetd for package: telnet-server?
---> Finished Dependency Resolution?
Error: Missing Dependency: xinetd is needed by package telnet-server?
[root@rhel5 Server]#?yum install xinetd?
Loading "security" plugin?
Loading "rhnplugin" plugin?
Loading "installonlyn" plugin?
This system is not registered with RHN.?
RHN support will be disabled.?
Setting up Install Process?
Setting up repositories?
Reading repository metadata in from local files?
Parsing package install arguments?
No Match for argument: xinetd?
Nothing to do?
[root@rhel5 Server]# ls |grep xinetd?
xinetd-2.3.14-10.el5.i386.rpm?
[root@rhel5 Server]#?rpm -ivh xinetd-2.3.14-10.el5.i386.rpm?
Preparing...??????????????? ########################################### [100%]?
?? 1:xinetd???????????????? ########################################### [100%]?
[root@rhel5 Server]# yum install telnet*?
Loading "security" plugin?
Loading "rhnplugin" plugin?
Loading "installonlyn" plugin?
This system is not registered with RHN.?
RHN support will be disabled.?
Setting up Install Process?
Setting up repositories?
Reading repository metadata in from local files?
Parsing package install arguments?
Examining telnet-0.17-38.el5.i386.rpm: telnet - 1:0.17-38.el5.i386?
telnet-0.17-38.el5.i386.rpm: does not update installed package.?
Examining telnet-server-0.17-38.el5.i386.rpm: telnet-server - 1:0.17-38.el5.i386?
Marking telnet-server-0.17-38.el5.i386.rpm to be installed?
Resolving Dependencies?
---> Populating transaction set with selected packages. Please wait.?
---> Package telnet-server.i386 1:0.17-38.el5 set to be updated?
---> Running transaction check Dependencies Resolved =============================================================================?
Package???????????????? Arch?????? Version????????? Repository??????? Size?
=============================================================================?
Installing:?
telnet-server?????????? i386?????? 1:0.17-38.el5??? telnet-server-0.17-38.el5.i386.rpm?? 49 k Transaction Summary?
=============================================================================?
Install????? 1 Package(s)?????????
Update?????? 0 Package(s)?????????
Remove?????? 0 Package(s)???????? Total download size: 49 k?
Is this ok [y/N]:?y ? y,就開始安裝了 Downloading Packages:?
Running Transaction Test?
Finished Transaction Test?
Transaction Test Succeeded?
Running Transaction?
? Installing: telnet-server??????????????? ######################### [1/1] Installed: telnet-server.i386 1:0.17-38.el5?
Complete!?
[root@rhel5 Server]# 現(xiàn)在這個目錄里就有telnet這個文件了,我們來看看這個文件 修改配置文件開啟telnet #vim /etc/xinetd.d/telnet 將文件最后disable =yes中的yes改成no,然后保存退出。 disable 是控制語句,為yes就是不啟動telnet,我們把他改成no 保存退出。 安裝好以后啟動服務(wù)了,這個就要借助我們系統(tǒng)服務(wù)方面的知識了。telnet是基于xinetd的服務(wù),所以我要先在配置文件中將服務(wù)開啟,然后在重新啟動xinetd服務(wù)。 然后重新啟動xinetd的服務(wù):service xinetd restart? OK,由于xinetd服務(wù)是基于System V的服務(wù),所以我們可以這樣重新啟動 記住,修改了XINETD服務(wù)的時候,要重新啟動xinetd才能生效 這樣我們的telnet服務(wù)器就開啟了,你可以在xp里面試試看能不能登陸,如果不行,我們就還需要一個設(shè)置,在/etc/hosts 文件中加入服務(wù)器和client的正向解析,域名可以亂取,只要IP地址對應(yīng)就OK了。 修改/etc/hosts?
然后我們用XP進(jìn)行測試哈~:telnet 192.168.0.188 登錄失敗哈~~ 請大家注意:root是不可以通過telnet登陸的,我們可以使用普通用戶登錄,然后使用su命令到超級用戶哈,還有就是telnet是明文傳輸,一點都不安全哈,建議只在測試時候使用telnet。 測試成功哈~~~ ############################################################################# 下面我們介紹另一個遠(yuǎn)程控制軟件ssh,安全的shell。使用22號端口,支持加密。用于替代明文傳輸?shù)膖elnet,還支持遠(yuǎn)端文件交換。 配置ssh服務(wù)器 1、安裝sshd:yum install sshd* 一般SSH是在我們安裝RHEL5系統(tǒng)時已經(jīng)默認(rèn)安裝了 2、重新啟動sshd服務(wù):service sshd restart 安裝以后直接重新啟動服務(wù)就OK了,現(xiàn)在ssh服務(wù)器就OK了哈 3、使用putty工具軟件進(jìn)行連接 我使用的是putty.exe這個軟件,是免費的。很好用,putty是不需要安裝的,這就是他滴好處哈~ 在host name填入ssh服務(wù)器的IP地址 然后點open,開始連接,下面是SSH服務(wù)器給你的rsa key,點是,同意安裝密匙。 然后登陸。 接下來還就個常用命令,需要在Linux做為Client才好實現(xiàn),我給大家用另一個Linux做為Client演示下。 scp :基于SSH的安全遠(yuǎn)端拷貝文件與目錄 scp命令語法: 1、將本地文件拷貝到遠(yuǎn)端 scp 文件 用戶@ 主機名:遠(yuǎn)端目錄 2、講遠(yuǎn)端目錄拷貝到本地 scp -r? 用戶@主機名:遠(yuǎn)端目錄?? 本地目錄 1、將本地的install.log 拷貝到服務(wù)器的/home/michael目錄 scp install.log?michael@192.168.0.188:/home/michael 我們驗證下哈~確實已經(jīng)上傳到RHEL5服務(wù)器的/home/michael/目錄下了哈~ 我們準(zhǔn)備下一個試驗的文件51cto.tar哈~ 2、將遠(yuǎn)端目錄/home/michael/51cto.tar拷貝到本地/tmp scp -r?michael@192.168.0.188:/home/michael/51cto.tar?/tmp/
本文轉(zhuǎn)自redking51CTO博客,原文鏈接:http://blog.51cto.com/redking/121742,如需轉(zhuǎn)載請自行聯(lián)系原作者
總結(jié)
以上是生活随笔為你收集整理的RHCE课程-RH131Linux管理笔记五-Linux远程登陆telnet及ssh服务的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java简单多线程断点下载
- 下一篇: iOS 开发之 OOA (面向对象分析)