telnet相信大家都不陌生,在
RHCE课程-RH131Linux管理笔记三-linux系统服务介绍及管理里面我们已经配置过了,我也不多做介绍,直接说安装吧。
使用yum安装的前提是你已经配置好YUM client端,具体参见
RHCE课程-RH131Linux管理笔记一-RPM及其管理,YUM客户端及服务器的配置
#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
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
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)
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 49 k
Is this ok [y/N]: y
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]
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]#
Complete!
[root@rhel5 Server]#
现在这个目录里就有telnet这个文件了,我们来看看这个文件
![](https://i-blog.csdnimg.cn/blog_migrate/135d5f27062919f46ca1f81869a59e5d.png)
修改配置文件开启telnet
#vim /etc/xinetd.d/telnet
将文件最后disable =yes中的yes改成no,然后保存退出。
![](https://i-blog.csdnimg.cn/blog_migrate/b23c90f34343b4dfcaa3d1b9cf885778.png)
disable 是控制语句,为yes就是不启动telnet,我们把他改成no
![](https://i-blog.csdnimg.cn/blog_migrate/24ca4f654fe5e34c7e50c76f3910e7d3.png)
保存退出。
安装好以后启动服务了,这个就要借助我们系统服务方面的知识了。telnet是基于xinetd的服务,所以我要先在配置文件中将服务开启,然后在重新启动xinetd服务。
然后重新启动xinetd的服务:
service xinetd restart
![](https://i-blog.csdnimg.cn/blog_migrate/ff24b84f7ed60081bc4a40f809d3e26e.png)
OK,由于xinetd服务是基于System V的服务,所以我们可以这样重新启动
记住,修改了XINETD服务的时候,要重新启动xinetd才能生效
这样我们的telnet服务器就开启了,你可以在xp里面试试看能不能登陆,如果不行,我们就还需要一个设置,在/etc/hosts 文件中加入服务器和client的正向解析,域名可以乱取,只要IP地址对应就OK了。
然后我们用XP进行测试哈~:
telnet 192.168.0.188
登录失败哈~~
请大家注意:root是不可以通过telnet登陆的,我们可以使用普通用户登录,然后使用su命令到超级用户哈,还有就是telnet是明文传输,一点都不安全哈,建议只在测试时候使用telnet。
测试成功哈~~~
#############################################################################
下面我们介绍另一个远程控制软件ssh,安全的shell。使用22号端口,支持加密。用于替代明文传输的telnet,还支持远端文件交换。
配置ssh服务器
1、安装sshd:yum install sshd*
一般SSH是在我们安装RHEL5系统时已经默认安装了
2、重新启动sshd服务:service sshd restart
安装以后直接重新启动服务就OK了,现在ssh服务器就OK了哈
3、使用putty工具软件进行连接
我使用的是putty.exe这个软件,是免费的。很好用,putty是不需要安装的,这就是他滴好处哈~
在host name填入ssh服务器的IP地址
然后点open,开始连接,下面是SSH服务器给你的rsa key,点是,同意安装密匙。
然后登陆。
接下来还就个常用命令,需要在Linux做为Client才好实现,我给大家用另一个Linux做为Client演示下。
scp :基于SSH的安全远端拷贝文件与目录
scp命令语法:
1、将本地文件拷贝到远端
scp 文件 用户@ 主机名:远端目录
2、讲远端目录拷贝到本地
scp -r 用户@主机名:远端目录 本地目录
1、将本地的install.log 拷贝到服务器的/home/michael目录
scp install.log
michael@192.168.0.188:/home/michael
我们验证下哈~确实已经上传到RHEL5服务器的/home/michael/目录下了哈~
我们准备下一个试验的文件51cto.tar哈~
2、将远端目录/home/michael/51cto.tar拷贝到本地/tmp
scp -r
michael@192.168.0.188:/home/michael/51cto.tar
/tmp/
本文转自redking51CTO博客,原文链接:http://blog.51cto.com/redking/121742
,如需转载请自行联系原作者