ssh

Run remote commands through SSH tunnel in Java

不羁岁月 提交于 2020-02-21 06:12:27
问题 I need to run some commands from a remote computer using an SSH connection, but the problem is the following: The client computer (running Windows) is connected to a network where I can see a server remote (second *nix computer, in the same network). I can do SSH connections with it, however the computer that contains the files (running *nix) isn't in this network, I only can connect with this trough a dynamic SSH tunnel open in the second computer, where I normally use PuTTY to configure

Run remote commands through SSH tunnel in Java

核能气质少年 提交于 2020-02-21 06:12:05
问题 I need to run some commands from a remote computer using an SSH connection, but the problem is the following: The client computer (running Windows) is connected to a network where I can see a server remote (second *nix computer, in the same network). I can do SSH connections with it, however the computer that contains the files (running *nix) isn't in this network, I only can connect with this trough a dynamic SSH tunnel open in the second computer, where I normally use PuTTY to configure

通过ssh开启代理xshell开socket代理

喜你入骨 提交于 2020-02-21 05:21:46
工具: 一个ssh账户,可以连接到一台Linux服务器 本地安装xshell 方法步骤: 第一步:使用xshell,ssh连接到Linux服务器 第二步:点击查看,选择隧道窗格,随后xshell,最下面就会显示隧道窗口,最底部。 第三步:点击到转移规则上,右击添加,类型选择SOCK5,端口设置一个未占用的端口,然后点击确定。 第四步:等设置好了以后最下面的状态是打开的,就表示已经设置成功了,此时我们可以在IE中添加添加,当然了也可以使用代理工具来进行代理,我这里就拿SwitchyOmega来进行演示了。 第五步:点击SwitchyOmega的选项,选择新建情景模式,代理协议选择SOCK5,代理服务器设置为127.0.0.1,端口设置为刚刚在Xshell中设置的端口,把下面不代理的地址列表中的127.0.0.1去除掉,最后点击右下角的应用选项即可。 第六步:在浏览器中选择刚刚设置的代理,然后访问百度,输入ip,查询当前ip为代理ip表示成功。 来源: CSDN 作者: cj_hydra 链接: https://blog.csdn.net/cj_Allen/article/details/104413549

SUSE系统UNISON+inotify数据的双向实时同步

一曲冷凌霜 提交于 2020-02-21 04:12:28
UNISON安装部署手册 操作系统:SUSE12 安装包:inotify-tools-3.13.tar.gz ocaml-4.02.0.tar.gz unison-2.48.4.tar.gz 主机:FH-UMP-PORTAL1 192.168.1.181 FH-UMP-PORTAL2 192.168.1.182 登录用户/密码:root/123456 配置文件:/root/.unison/default.prf Unison双向同步基本原理是:假如有A B两个文件夹,A文件夹把自己的改动同步到B,B文件夹也把自己的改动同步到A,最后A B两文件夹的内容相同,是AB文件夹的合集。 Unison双向同步的一个缺点是,对于一个文件在两个同步文件夹中都被修改时,unison是不会去同步的,因为unison无法判断以那个为准。 一、安装前的准备 1. 查看空间大小 # df -h 2. 创建目录 #mkdir /opt/unison 3. 上传安装包到指定目录 二、解压及安装 4. 解压、编译、安装 (1) 对于ocaml-4.02.0.tar.gz(Linux下通过源码包编译安装Unison时,需要用到Objective Caml compiler) 解压:#tar zxfv ocaml-4.02.0.tar.gz 进入解压目录:#cd ocaml-4.02.0 配置:#.

metasploit扫描

泄露秘密 提交于 2020-02-21 03:14:36
实验目的 : 一、 基于TCP协议收集主机信息 二、 基于SNMP协议收集主机信息 三、 基于SMB协议收集信息 四、 基于SSH协议收集信息 五、 基于FTP协议收集信息 实验环境:kali、win7、metasploitable2 0 开始环境搭建 首先win7环境搭建 : 打开vmware,选择创建新的虚拟机。 ​这里选择典型安装,比较方便。(考虑到对2020版有些使用的不习惯,下面在遇到坑点会给出解决方式) 选择版本Linux -》Debian 6 64位 选择位置 推荐C盘以外的位置 因为是测试环境,选择默认大小就好 保存为单个文件 选择自定义硬件 这里修改下内存分配在1G空间就好 。 点击关闭,完成创建。 ​开启虚拟机,选择Graphical install 安装 等待一会 ,选择中文简体(为什么选择个呢,其他的我看不懂) 进入 等待一会 1处修改任意 1处符合格式 2继续 因为是虚拟机的网络配置为NAT,所以直接进入到配置用户名密码处 等待一会,配置时间中 因为是测试环境,这里选择第一个 继续,这里的三个选项,都可以。本人懒所以选第一个 继续 结束设定 开始安装基本系统,等待一小会。。。 扫描镜像站,时间太长。。。不推荐在这里使用网络镜像 如果在这里填写成错会显示找不到站点。否则是漫长的等待,等待时上1小时左右,网卡者更长。。。 当这里出错时

can't use gpg-agent as an ssh agent

限于喜欢 提交于 2020-02-20 11:38:58
问题 I've been trying to get gpg-agent to work as an ssh agent, but without any luck. I'm running the KDE version of Linux Mint (Sarah). First, I disabled the built-in ssh agent in /etc/X11/Xsession.options: # $Id: Xsession.options 189 2005-06-11 00:04:27Z branden $ # # configuration options for /etc/X11/Xsession # See Xsession.options(5) for an explanation of the available options. allow-failsafe allow-user-resources allow-user-xsession #use-ssh-agent use-session-dbus Then, I enabled the ssh

can't use gpg-agent as an ssh agent

让人想犯罪 __ 提交于 2020-02-20 11:37:07
问题 I've been trying to get gpg-agent to work as an ssh agent, but without any luck. I'm running the KDE version of Linux Mint (Sarah). First, I disabled the built-in ssh agent in /etc/X11/Xsession.options: # $Id: Xsession.options 189 2005-06-11 00:04:27Z branden $ # # configuration options for /etc/X11/Xsession # See Xsession.options(5) for an explanation of the available options. allow-failsafe allow-user-resources allow-user-xsession #use-ssh-agent use-session-dbus Then, I enabled the ssh

CMDB收集资产脚本

我怕爱的太早我们不能终老 提交于 2020-02-20 06:12:32
CMDB概述 自动化运维特性 OS的选择统一化,同一个项目使用同样的OS系统部署其所需要的各类软件 软件安装标准化,例如JAVA虚拟机,php,nginx,mysql等各类应用需要的软件版本,安装目录,数据存放目录,日志存放目录等 应用包目录统一标准化,及应用命名标准化 启动脚本统一目录和名字,需要变化的部分通过参数传递 配置文件标准化,需要变化的部分通过参数传递 日志输出,日志目录,日志名字标准化 应用生成的数据要实现统一的目录存放 主机/虚拟机命名标准化,虚拟机管理使用标准化模板 使用docker比较容易实现软件运行环境的标准化 CMDB架构 CMDB设计模式 Agent方式 可以将服务器上面的Agent程序作定时任务( crontab ),定时将资产信息提交到指定API录入数据库 本质上就是在各个服务器上执行 subprocess.getoutput() 命令,然后将每台机器上执行的结果,返回给主机API,然后主机API收到这些数据之后,放入到数据库中,最终通过web界面展现给用户。 优点:速度快 场景:适合机器多的情况 缺点:每个机器都要部署脚本 SSH方式(paramiko模块) 中控机通过paramiko模块登录到各个服务器上,执行命令获取服务器信息。 import paramiko # 创建SSH对象 ssh = paramiko.SSHClient() #

SSH connection using Java

筅森魡賤 提交于 2020-02-20 05:28:50
问题 I am trying to establish an SSH connection through my Java code, but getting below exception .. I tested my connection through Putty/Winscp tools and it works fine. The problem is with my Java code... SEVERE: The Transport Protocol thread failed java.io.IOException: The socket is EOF at com.sshtools.j2ssh.transport.TransportProtocolInputStream.readBufferedData(Unknown Source) at com.sshtools.j2ssh.transport.TransportProtocolInputStream.readMessage(Unknown Source) at com.sshtools.j2ssh

隧道、SVN相关

给你一囗甜甜゛ 提交于 2020-02-19 09:57:19
指定用户登录 ssh -l root 192.168.168.100 ssh root@192.168.168.100 本地转发隧道 ssh -L 33686:192.168.168.101:3686 appmon@192.168.168.101 -p 20000 ssh -N -L 33686:192.168.168.101:3686 appmon@192.168.168.101 -p 20000 ssh -f -N -L 33686:192.168.168.101:3686 appmon@192.168.168.101 -p 20000 参数 -N 和 -L 位置不能交换 ps -ef | grep ssh kill SVN指定用户登录 svn ls svn://127.0.0.1:33686 --username hosea svn ls svn://127.0.0.1:33686 --username hosea --password 750246 来源: https://www.cnblogs.com/hosealyu1996/p/12329756.html