netconf ssh

NETCONF协议详解

https://blog.csdn.net/anzheangel/article/details/78885880

Hi Viraj,
our software consists of 2 main packages:

libnetconf is a library that is meant for building NETCONF servers and clients with everything that is required.
netopeer is an implementation of a full NETCONF server (netopeer-server) and a NETCONF client (netopeer-cli). It is build using libnetconf and is ready to be deployed and used.
However, libnetconf is now quite old and no longer updated, only maintained. There are several known issues (which will not be fixed) and it often does things ineffectively and is generally quite complex. That is why we started from scratch and are working on a new generation of this software:

libnetconf2 is a NETCONF library just like libnetconf, but excludes YANG module processing and a datastore implementation, these are provided separately.
libyang is a library for YANG module processing, as mentioned previously, required by libnetconf2.
sysrepo is a complex datastore implementation, but it is actually meant to manage and interconnect all the applications and their configuration files on a system. This is not developed by us, but we cooperate with its development team.
netopeer2 is again a NETCONF server and a client, which uses libnetconf2 and sysrepo for a fully working NETCONF solution.
The new generation is usable and offers some basic functionality, but it is still work-in-progress and definitely not ready for deployment.

Regards,
Michal

 

https://github.com/CESNET/Netopeer2

 

SSH协议详解

https://blog.csdn.net/vevenlcf/article/details/43273405

ssh协议的原理,你有可能还不知道

https://blog.csdn.net/somezz/article/details/82141552

使用apache sshd,构建一个sshd server

		
			org.apache.sshd
			sshd-core
			2.2.0
		

		
			org.slf4j
			slf4j-simple
			1.7.26
		


package gaofeng.netconf;

import java.io.IOException;
import java.nio.file.Paths;
import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
import org.apache.sshd.server.shell.ProcessShellFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class App {
    private static Logger log = LoggerFactory.getILoggerFactory().getLogger(App.class.getName());
    public static void main(String[] args) throws IOException, InterruptedException {
        System.out.println("Hello World!");
        log.info("hello,gaofeng");
        SshServer sshd = SshServer.setUpDefaultServer();
        sshd.setHost("127.0.0.1");
        sshd.setPort(2222);
        sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(Paths.get( "key.ser")));
        //服务器第一次启动,产生一个随机密钥,存储在这里。下次重启,继续使用这个密钥。否则客户端需要删除known_hosts中保存的服务器公钥。

        sshd.setPasswordAuthenticator(
                (username,  password,  session) -> 
                { log.info(username + "  " + password);  return true;}
       );
//        sshd.setShellFactory(new ProcessShellFactory(new String[] { "/bin/sh.exe", "-i", "-l" }));
        sshd.setShellFactory( new ProcessShellFactory(new String[] { "cmd.exe" }));
        
        sshd.start();
        Thread.sleep(300*1000);
    }
}

控制台打印
Hello World!
[main] INFO gaofeng.netconf.App - hello,gaofeng
[main] INFO org.apache.sshd.common.io.DefaultIoServiceFactoryFactory - No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory
[sshd-SshServer[12c72c2](port=2222)-nio2-thread-5] INFO gaofeng.netconf.App - root  yy
[sshd-SshServer[12c72c2](port=2222)-nio2-thread-5] INFO org.apache.sshd.server.session.ServerUserAuthService - Session root@/127.0.0.1:61274 authenticated

Linux ssh命令详解   

使用2222端口登陆 ssh -p2222 [email protected]

ssh原理

https://blog.csdn.net/vic_qxz/article/details/80537396

你可能感兴趣的:(work)