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数据结构转换等.这 ...
随机推荐
- 关于IDEA中Tomcat中文乱码的解决方案
进入Tomcat/config文件夹下,打开编辑logging.properties 然后查看该文件内是否存在java.util.logging.ConsoleHandler.encoding = U ...
- 整理一些Windows桌面运维常用的命令,并且整合成脚本
github地址:alittlemc/toy: 编写些脚本将运维经常所用到小玩意所集成在一起 (github.com) 持续更新! 前言 做过桌面运维的大佬们应该可以很明显感受到这份工作所需要的技能不 ...
- 【机器学习】利用 Python 进行数据分析的环境配置 Windows(Jupyter,Matplotlib,Pandas)
环境配置 安装 python 博主使用的版本是 3.10.6 在 Windows 系统上使用 Virtualenv 搭建虚拟环境 安装 Virtualenv 打开 cmd 输入并执行 pip inst ...
- Hive之安装
Hive安装 1. 依赖hadoop(另有hadoop安装文档) 执行程序运行在yarn上面,需要启动start-yarn.sh 2. 先安装MySQL MySQL安装详见数据库MySQL之安装:ht ...
- SQL语句编写的练习(MySQL)
SQL语句编写的练习(MySQL) 一.建表 1.学生表(Student) 学号 | 姓名 | 性别 | 出生年月 | 所在班级 create table Student( sno varchar(2 ...
- 1、在SrpingBoot的环境当中使用JSP及相关功能
创建webapp目录 由于SpringBoot项目不建议直接访问jsp页面,但是我现在要做的事情需要去访问,那么我就需要在原有的项目基础上为访问jsp页面进行一个调整 首先在项目当中,java和res ...
- ElasticSearch之Windows中环境安装
ElasticSearch 说明 本章,我们主要以在 Windows 中对ElasticSearch 安装进行介绍! 1. 下载 ElasticSearch 这里我们下载的版本为7.17.4为例进行介 ...
- 题解 P3395 路障
前言 没想到这是\(\sf {tgD1T1}\)难度-- 题目大意 有一个\(n\times n\) 的棋盘,有\(2n-2\) 个路障,在第\(i\) 秒会在\((x_i,y_i)\) 放置路障.求 ...
- Java开发学习(三十九)----SpringBoot整合mybatis
一.回顾Spring整合Mybatis Spring 整合 Mybatis 需要定义很多配置类 SpringConfig 配置类 导入 JdbcConfig 配置类 导入 MybatisConfig ...
- Linux--多线程(三)
生产者消费者模型 概念: 生产者消费者模式就是通过一个容器来解决生产者和消费者的强耦合问题.生产者和消费者彼此之间不直接通讯,而通过一个来进行通讯,所以生产者生产完数据之后不用等待消费者处理,直接扔给 ...