linux开启telnet服务
1。基础知识
linux提供服务是由运行在后台的守护程序(daemon)来执行的。
守护进程的工作就是打开1个端口(port),等待(listen)进入的连接。
在C/S模式中,如果客户提请了1个连接,守护进程就创建(fork)子进程来响应这个连接,而父进程继续监听其他服务的请求。
但是,对于系统所提供的每1个服务,如果都必须运行1个监听某个端口连接发生的守护程序,那么通常意味着系统资源的浪费。
为此,引入“扩展的网络守护进程服务程序”xinetd(xinetd internet daemon)。telnet服务也是由xinetd守护的。
2。检测telnet、telnet-server的rpm包是否安装
[root@localhost ~]# rpm -qa telnet
telnet-0.17-39.el5
//telnet*.rpm是默认安装的//
[root@localhost root]#rpm -qa telnet-server
空
//telnet*.rpm是默认没有安装的//
3。安装telnet-server
[root@localhost ~]# rpm -qa telnet-server
[root@localhost ~]# rpm -ivh /mnt/Server/telnet-server-0.17-39.el5.i386.rpm
warning: /mnt/Server/telnet-server-0.17-39.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:telnet-server ########################################### [100%]
[root@localhost ~]#
4。修改telnet服务配置文件
vi /etc/xinetd.d/telnet
service telnet
{
disable = yes
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
将disable=yes行前加#,或者改为disable=no
5。重新启动xinetd守护进程
由于telnet服务也是由xinetd守护的,所以安装完telnet-server,要启动telnet服务就必须重新启动xinetd
[root@localhost root]#service xinetd restart
或
[root@localhost root]#/etc/init.d/xinetd restart
Stopping xinetd:  
相关文档:
linux目录说明
/bin
这是放例如: ls, mv, rm, mkdir, rmdir, gzip, tar, telnet, 及 ftp 等等常用
的执行档的地方(这些执行档的执行方法会在后面提到),有时候这个目录的内容
与 /usr/bin 是一样的(有时候甚至会使用连结档哩),是给一般使用者使用的执
行程序放置的所在!
/boot
没错,这里就是放置你 Linu ......
转自:
http://blog.chinaunix.net/u2/63316/showart_547992.html
Linux下的目录是依照标准来实作的,因此,您可以毫无问题地移殖到任何其它UNIX平台。
--------------------------------------------------------------------------------
getcwd/getwd : 取得目前所在目录
--------------- ......
http://blog.csdn.net/noah1987/archive/2008/10/21/3118934.aspx
本程序可以读取.wav文件,然后进行播放。
使用前,请确认您是否安装音频驱动。
确认方法:cat /etc/sndstat,如果显示无此设备,则没有安装驱动。
安装驱动很简单,到oss.com上下载音频驱动,然后按照网上的教程进行就可以了。
源代码如下:
#include ......
本程序可以读取.wav文件,然后进行播放。
确认方法:cat /etc/sndstat,如果显示无此设备,则没有安装驱动。
#include <unistd.h>#include <fcntl.h>#include <sys/types.h>#include <sys/ioctl.h>#include <stdlib.h>#include <stdio.h>#include&nbs ......
linux—select详解
select系统调用时用来让我们的程序监视多个文件句柄的状态变化的。程序会停在select这里等待,直到被监视的文件句柄有一个或多个发生了状态改变。
关于文件句柄,其实就是一个整数,通过socket函数的声明就明白了:
int socket(int domain, int type, int protocol);
我们最熟悉的句柄是0、1、2 ......