Skip to content

mpak/connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shortcut for ssh, scp and telnet commands

No more need remember and type long host names, just configure short aliases for them.

Script written in Perl. Configuration is stored in YAML format.

USAGE

# optional arguments for ssh or telnet command
c [arguments] server
# copy files with scp
c [arguments] server:/from/path1 to/local/path
c [arguments] from/local/path1 server:/to/path
# show full command
c -h server
# show only host (for usage in scripts)
c server^
# ping host
c server^ping

EXAMPLES

With config from c.example.yaml

SSH

# connect via ssh
c radius
# both connect to same server:
c db
c mysql

SCP

# copy files from server
c radius:/etc/hosts .
c radius:/etc/hosts radius-hosts
c radius:/path/to/{file1,file2}
c -r radius:/file1 radius:/file2 voip:/some/dir /tmp/

# copy local directory and file to server
c -r some/dir misc.txt radius:/tmp/

Telnet

# connect via telnet
c router

Other

c gw -h
# output: ssh -R52698:127.0.0.1:52698 -A -p 22000 [email protected]
c voip^
# output: voip.example.com
c voip^ping
# ping that host

INSTALL

Copy c script somewhere in $PATH and create .c.yaml in $HOME directory.

Then install required perl module with command cpan YAML::Tiny

Changes

  • 2014-11-07 - v0.006

    extend ^ syntax with ping command

  • 2014-08-14 - v0.005

    syntax for printing origin host

About

Shortcut for ssh, scp and telnet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages