netkit-telnet源码编译安装
介绍
Linux 下流行的 telnet 实现有两个:
GNU inetutils: http://ftp.gnu.org/gnu/inetutils/
哈佛netkit-telnet
编译
编译环境
Ubuntu 20.04.4 LTS
编译telnet-0.17
下载并解压安装包netkit-telnet_0.17.orig.tar.gz
编译源码
netkit-telnet-0.17# ./configure
netkit-telnet-0.17# make
遇到的问题
官方的代码编译还是会遇到一些代码本身的问题,需要做些修改。
undefined reference
commands.cc:(.text+0x25c4): undefined reference to `operator new(unsigned long)'
/usr/bin/ld: commands.cc:(.text+0x2651): undefined reference to `operator new(unsigned long)'
/usr/bin/ld: commands.cc:(.text+0x26e1): undefined reference to `operator new(unsigned long)'
collect2: error: ld returned 1 exit status
原因:
申明了函数却没实现,一般是链接阶段出现
netkit-telnet-0.17# ./configure
Looking for a C++ compiler... gcc <<< 发现编译c++文件应该编译器要选g++
解决:修改configure文件中c++文件的编译器
# git diff
diff --git a/configure b/configure
index 429167a..e8780e7 100755
--- a/configure
+++ b/configure
@@ -122,7 +122,7 @@ EOF
if [ x"$CXX" = x ]; then
echo -n 'Looking for a C++ compiler... '
- for TRY in egcs gcc g++ CC c++ cc; do
+ for TRY in egcs g++ CC c++ cc; do <<<修改
exit函数不存在
main.cc:92:2: error: 'exit' was not declared in this scope; did you mean 'Exit'?
92 | exit(1);
| ^~~~
| Exit
make[1]: *** [../MRULES:7: main.o] Error 1
make[1]: Leaving directory 'netkit-telnet-0.17/telnet'
make: *** [Makefile:8: telnet.build] Error 2
解决:
添加头文件
#include <cstdlib>
error: 'memcpy' was not declared
terminal.cc:696:5: error: 'memcpy' was not declared in this scope
696 | memcpy(new_tc.c_cc, old_tc.c_cc, sizeof(old_tc.c_cc));
解决:
c++ - ‘memcpy’ was not declared in this scope - Stack Overflow
运行
编译完成后生成可执行文件
//客户端
netkit-telnet-0.17/telnet/telnet
//服务端
netkit-telnet-0.17/telnetd/telnetd
运行client端
netkit-telnet-0.17/telnet# ./telnet
telnet> ?
Commands may be abbreviated. Commands are:
close close current connection
logout forcibly logout remote user and close the connection
display display operating parameters
mode try to enter line or character mode ('mode ?' for more)
open connect to a site
quit exit telnet
send transmit special characters ('send ?' for more)
set set operating parameters ('set ?' for more)
unset unset operating parameters ('unset ?' for more)
status print status information
toggle toggle operating parameters ('toggle ?' for more)
slc set treatment of special characters
z suspend telnet
environ change environment variables ('environ ?' for more)
运行server端
netkit-telnet-0.17/telnetd# ./telnetd -n
Usage: telnetd [-debug] [-D (options|report|exercise|netdata|ptydata)]
[-h] [-L login_program] [-n] [port]
netkit-telnet源码编译安装的更多相关文章
- Centos7.X 源码编译安装subversion svn1.8.x
说明:SVN(subversion)的运行方式有两种:一种是基于Apache的http.https网页访问形式:还有一种是基于svnserve的独立服务器模式.SVN的数据存储方式也有两种:一种是在B ...
- Linux 从源码编译安装 OpenSSH
https://blog.csdn.net/bytxl/article/details/46639073 Linux 从源码编译安装 OpenSSH以及各问题解决 2015年06月25日 17:37: ...
- SSH/SSL 源码编译安装简易操作说明
环境:CentOS 6.7 安全加固需求,由于某盟扫描系统主机有SSL系列漏洞,客户要求必须修复: 解决方案:将SSH/SSL升级到最新版本,删除SSL旧版本(实测不删除旧版本某盟扫描无法通过). 当 ...
- 源码编译安装 MySQL 5.5.x 实践
1.安装cmakeMySQL从5.5版本开始,通过./configure进行编译配置方式已经被取消,取而代之的是cmake工具.因此,我们首先要在系统中源码编译安装cmake工具. # wget ht ...
- 烂泥:mysql5.5数据库cmake源码编译安装
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 以前也写过一篇有关mysql5.0源码编译的文章,该文章为<烂泥:mysql5.0数据库源码编译安装>.但是MySQL自5.5版本以后,就开 ...
- centos6.5环境源码编译安装mysql5.6.34
centos6.5环境源码编译安装mysql5.6.34 源码下载地址http://dev.mysql.com/downloads/mysql/5.6.html#downloads 选择Generic ...
- centos 6.5源码编译安装subversion 1.8.10
一.简介 CentOS 6.5的yum源可以安装的SVN客户端版本太低了,1.6.11,所以需要升级到1.8.10,而官网有没有找到1.8.10的安装包,只能选择源码编译安装. 二.安装步骤 参考官网 ...
- Linux环境PostgreSQL源码编译安装
Linux环境PostgreSQL源码编译安装 Linux版本: Red Hat 6.4 PostgreSQL版本: postgresql-9.3.2.tar.gz 数据存放目录: /var/post ...
- 总结源码编译安装mysql
最近在学习源码编译安装LAMP.LNMP时,一直遇到一个难题,就是就是mysql无论怎么源码编译安装,到最后启动服务都提示"Starting MySQL.The server quit wi ...
- Linux下源码编译安装rpy2
R(又称R语言)是一款开源的跨平台的数值统计和数值图形化展现工具.rpy2是Python直接调用R的第三方库,它可以实现使用python读取R的对象.调用R的方法以及Python与R数据结构转换等.这 ...
随机推荐
- C#-13 泛型
一 泛型 泛型提供了一种更优雅的方式,可以让多个类型共享一组代码.泛型允许我们声明类型参数化的代码,可以用不同的类型进行实例化. 也就是说,我们可以用"类型占位符"来写代码,然后在 ...
- C#-11 接口
一 什么是接口 接口是指定一组函数成员而不实现它们的引用类型. class Program { static void FlyFunc(IFly obj) { obj.Fly(); } static ...
- OCI runtime exec failed: exec failed: unable to start container process: exec: "mongo": executable file not found in $PATH: unknown
前言: 今天按照以往在Docker安装MongoDB的方式安装,但是到最后使用mongo命令执行mongodb命令的时候一直执行不成功,最后还是按照官网的Issues解决了. 创建并运行一个Mongo ...
- hwj是猪
黄伟佳不爱我了吧唧吧唧
- 用copyof来复制数组
public static void main(String[] args) { //Arrays.copyOf将数组复制到另一个数组,截断.扩容 String[] a={"1", ...
- LcdTools如何编写MIPI指令(初始化代码)
在LcdTools帮助文档中查看MIPI读写指令描述,如下图 编写LCM初始化代码就是配置LCM Driver IC寄存器值,一般只需用MipiWrite()指令写参数即可:下面介绍MipiWrite ...
- ubuntu下Mysql安装与root密码重置
一.安装 1.首先更新本地存储库索引,执行sudo apt update 2.从APT存储库安装MySQL,执行sudo apt install MySQL-server,在安装过程中,可能会出现[Y ...
- 现代 CSS 指南 -- at-rule 规则扫盲
大部分同学都用过 CSS 的屏幕宽度媒体查询,像是这样: @media screen and (min-width: 900px) { div { padding: 1rem 3rem; } } 这里 ...
- JVM堆内存转储
在发生内存溢出错误 java.lang.OutOfMemoryError 时, JVM自动执行堆内存转储,以方便事后进行排查和分析. JVM提供了一个命令行启动参数 HeapDumpOnOutOfMe ...
- 在 Tomcat 10.x 上部署 SpringMVC 5.x
在Tomcat10.x 上部署 SpringMVC 5.x的时候,项目一直无法访问 运行截图 原因 Tomcat10基于Jakarta EE 9,其中api的包名已经从javax更改到jakarat ...