Skip to content

pan2za/rctl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# 简介

rctl 用于远程管理海量linux设备。目前功能:
1、证书认证ssl加密数据传输
2、按类管理linux设备,发送命令
3、/tmp 日志记录,每台设备一个log文件
4、支持远程shell登录
5、由客户端发起链接,解决路由问题

## 使用

### 证书系统
使用相同的ca生成两个证书,一个是server.cer,一个是client-cert,注意生成server-cert的时候必须指明证书可以用于服务端的
创建私钥:openssl genrsa -out ca-key.pem 1024
创建证书请求:openssl req -new -out ca-req.csr -key ca-key.pem
自签署证书:openssl x509 -req -in ca-req.csr -out ca-cert.pem -signkey ca-key.pem -days 3650

生成server证书:openssl genrsa -out server-key.pem 1024
创建证书请求:openssl req -new -out server-req.csr -key server-key.pem
自签署证书:openssl x509 -req -in server-req.csr -out server-cert.pem -signkey server-key.pem -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -days 3650

生成client证书:openssl genrsa -out client-key.pem 1024  
创建证书请求:openssl req -new -out client-req.csr -key client-key.pem 
自签署证书:openssl x509 -req -in client-req.csr -out client-cert.pem -signkey client-key.pem -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -days 3650 

cp server-key.pem /etc/rctl/rctl_priv.pem
cp server-cert.pem /etc/rctl/rctl_cert.pem
cp ca-cert.pem /etc/ssl/certs/wirelesser_ca.crt

### 命令

server:

	[jianxi@jianxi rctl]$ ./server/rctlser 
	1: list all class
	2: list all client
	3: send command to all client
	4: connect bash to client

client:
	
	[jianxi@jianxi rctl]$ ./client/rctlcli -c ens32 -w ens32 -d 0 -s <your-server-ip>
	(10975) rctl.c +105 r_connect(): DEBUG: Trying 1 ......
	(10975) rctl.c +57 r_server(): DEBUG: Try connect: 127.0.0.1
	(10975) rctl.c +125 r_connect(): DEBUG: Try 127.0.0.1 port: 7000
	(10975) rctl.c +132 r_connect(): DEBUG: connect failed
	Can not get: rctl.shanliren.net
	(10975) rctl.c +57 r_server(): DEBUG: Try connect: shanliren.net
	(10975) rctl.c +125 r_connect(): DEBUG: Try 123.254.109.239 port: 7000
	(10975) rctl.c +129 r_connect(): DEBUG: connect success
	
### 待完成

* client's -s command
* 配置文件
* vnc,instead of ssh

About

remote linux control

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 96.4%
  • Makefile 3.0%
  • Shell 0.6%