All Projects → pytool → ssh

pytool / ssh

Licence: Apache-2.0 license
golang ssh lib simple for use

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ssh

Winscp
WinSCP is a popular free SFTP and FTP client for Windows, a powerful file manager that will improve your productivity. It supports also Amazon S3, FTPS, SCP and WebDAV protocols. Power users can automate WinSCP using .NET assembly.
Stars: ✭ 794 (+5193.33%)
Mutual labels:  ssh, sftp
Snowflake
Graphical SFTP client and terminal emulator with helpful utilities
Stars: ✭ 1,676 (+11073.33%)
Mutual labels:  ssh, sftp
Cloudconnect
Cloud aware client to connect ssh, sftp and rdp
Stars: ✭ 25 (+66.67%)
Mutual labels:  ssh, sftp
Phpseclib
PHP Secure Communications Library
Stars: ✭ 4,627 (+30746.67%)
Mutual labels:  ssh, sftp
Wolfssh
wolfSSH is a small, fast, portable SSH implementation, including support for SCP and SFTP.
Stars: ✭ 142 (+846.67%)
Mutual labels:  ssh, sftp
Goph
🤘 The native golang ssh client to execute your commands over ssh connection. 🚀🚀
Stars: ✭ 734 (+4793.33%)
Mutual labels:  ssh, sftp
Webterminal
ssh rdp vnc telnet sftp bastion/jump web putty xshell terminal jumpserver audit realtime monitor rz/sz 堡垒机 云桌面 linux devops sftp websocket file management rz/sz otp 自动化运维 审计 录像 文件管理 sftp上传 实时监控 录像回放 网页版rz/sz上传下载/动态口令 django
Stars: ✭ 1,124 (+7393.33%)
Mutual labels:  ssh, sftp
Alfred Ssh
Open SSH/SFTP/mosh connections from Alfred 3+
Stars: ✭ 301 (+1906.67%)
Mutual labels:  ssh, sftp
S3 Sftp Proxy
An AWS S3 gateway proxying SFTP connections.
Stars: ✭ 112 (+646.67%)
Mutual labels:  ssh, sftp
Lssh
List selection type alternative ssh/scp/sftp client. Pure Go.
Stars: ✭ 110 (+633.33%)
Mutual labels:  ssh, sftp
Cowrie
Cowrie SSH/Telnet Honeypot https://cowrie.readthedocs.io
Stars: ✭ 3,810 (+25300%)
Mutual labels:  ssh, sftp
Grunt Sftp Deploy
Grunt task for code deployment over sftp
Stars: ✭ 158 (+953.33%)
Mutual labels:  ssh, sftp
Windterm
A quicker and better cross-platform SSH/Sftp/Shell/Telnet/Serial client.
Stars: ✭ 345 (+2200%)
Mutual labels:  ssh, sftp
Libssh2
the SSH library
Stars: ✭ 743 (+4853.33%)
Mutual labels:  ssh, sftp
Ssh Mitm
ssh mitm server for security audits supporting public key authentication, session hijacking and file manipulation
Stars: ✭ 335 (+2133.33%)
Mutual labels:  ssh, sftp
Git Web Client
[Abandoned] Web Git client using full stack Symfony2 with SSH/SFTP support
Stars: ✭ 32 (+113.33%)
Mutual labels:  ssh, sftp
Sync
syncs your local folder with remote folder using scp
Stars: ✭ 293 (+1853.33%)
Mutual labels:  ssh, sftp
Ftpgrab
Grab your files periodically from a remote FTP or SFTP server easily
Stars: ✭ 300 (+1900%)
Mutual labels:  ssh, sftp
Ssh2 Promise
ssh with promise/async await and typescript support
Stars: ✭ 110 (+633.33%)
Mutual labels:  ssh, sftp
Sshj
ssh, scp and sftp for java
Stars: ✭ 2,016 (+13340%)
Mutual labels:  ssh, sftp

项目简介

本项目是基于golang标准库 ssh 和 sftp 开发

本项目是对标准库进行一个简单的高层封装,使得可以在在 Windows Linux Mac 上非常容易的执行 ssh 命令, 以及文件,文件夹的上传,下载等操作.

  1. 当src 为目录时 文件上传下载模仿rsync: 只和源有关.
    // rsync -av src/ dst ./src/* --> /root/dst/*
    // rsync -av src/ dst/ ./src/* --> /root/dst/*
    // rsync -av src dst ./src/* --> /root/dst/src/*
    // rsync -av src dst/ ./src/* --> /root/dst/src/*
  2. 当src 为文件时 当dst为目录,以"/"结尾,则自动拼接上文件名 当dst为文件,不以“/”结尾时,则重命名文件

Install

go get github.com/pytool/ssh

Example

在远程执行ssh命令

提供3个方法: Run() Exec() Output()

  1. Run() : 程序执行后,不再受执行者控制. 适用于启动服务端进程.
  2. Exec() : 在控制台同步实时输出程序的执行结果.
  3. Output() : 会等待程序执行完成后,输出执行结果,在需要对执行的结果进行操作时使用.
package main
import (
	"fmt"
	"github.com/pytool/ssh"
)
func main() {

	c, err := ssh.NewClient("localhost", "22", "root", "ubuntu")
	if err != nil {
		panic(err)
	}
	defer c.Close()

	output, err := c.Output("uptime")
	if err != nil {
		panic(err)
	}

	fmt.Printf("Uptime: %s\n", output)
}

文件下载

package main

import (
	"github.com/pytool/ssh"
)

func main() {

	client, err := ssh.NewClient( "localhost", "22", "root", "ubuntu")
	if err != nil {
		panic(err)
	}
	defer client.Close()
	var remotedir = "/root/test/"
	// download dir
	var local = "/home/ubuntu/go/src/github.com/pytool/ssh/test/download/"
	client.Download(remotedir, local)

	// upload file
	var remotefile = "/root/test/file"

	client.Download(remotefile, local)
}

文件上传

package main

import (
	"github.com/pytool/ssh"
)

func main() {

	client, err := ssh.NewClient( "localhost", "22", "root", "ubuntu")
	if err != nil {
		panic(err)
	}
	defer client.Close()
	var remotedir = "/root/test/"
	// upload dir
	var local = "/home/ubuntu/go/src/github.com/pytool/ssh/test/upload/"
	client.Upload(local, remotedir)

	// upload file
	local = "/home/ubuntu/go/src/github.com/pytool/ssh/test/upload/file"
	client.Upload(local, remotedir)
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].