All Projects → Scalingo → Go Ssh Examples

Scalingo / Go Ssh Examples

Licence: bsd-2-clause
Go examples of SSH servers and clients

Programming Languages

go
31211 projects - #10 most used programming language

SSH Client/Server example with Go

Initialization

To setup a SSH server, a host ssh keypair (usually RSA) has to be created, to do so, run:

bash init.sh

Those files should have been created in the project directory:

  • ./host_key
  • ./host_key.pub

Simple client usage

go run client.go <user> <server:port> <command>

Example:

└> go run client.go foobar example.com:22 'ls /'
Password: *********
bin
boot
conf.d
dev
etc
home
initrd.img
lib
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
vmlinuz

Notes:

Please create issues, if you want more details.

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].