Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
/ssh-toolsPublic archive

Making SSH more convenient

License

NotificationsYou must be signed in to change notification settings

vaporup/ssh-tools

Repository files navigation

Moved  : https://codeberg.org/vaporup/ssh-toolsReason : https://github.blog/2023-03-09-raising-the-bar-for-software-security-github-2fa-begins-march-13/

Making SSH more convenient


ssh-ping

Check if host is reachable usingssh_config

  • OutputsReply from when server is reachable but login failed
  • OutputsPong from when server is reachable and login was successful
$ ssh-ping -c 3 kimSSHPING kimReply from kim: ssh_seq=1 time=109 msReply from kim: ssh_seq=2 time=136 msReply from kim: ssh_seq=3 time=141 ms--- kim ping statistics ---3 requests transmitted, 3 requests received, 0% request loss

TAB Completions

Ubuntu (and maybe other distros) ship completions for ssh which can be re-used:

Bash

complete -F _known_hosts ssh-ping

Zsh

compdef _ssh_hosts ssh-ping

Fish

complete -c ssh-ping -a "(__fish_print_hostnames)"

ssh-last

Likelast but for SSH sessions

# ssh-lastLOGIN            LOGOUT           DURATION   USER   HOST         PORT   AUTH_IDAug 14 03:45:34  Aug 14 03:48:06  00:02:32   swick  JumpHost     40548  (C) swick@companyAug 26 22:20:02  Aug 26 22:20:02  00:00:00   swick  192.168.1.5  48856  (?) passwordOct 14 13:43:49  Oct 14 13:44:29  00:00:40   root   192.168.1.5  45828  (K) sven.wick@gmx.deNov 02 12:16:58  still logged in  241:22:12  swick  192.168.1.5  59198  (K) SSHFS Mount

More info at thedocs

ssh-certinfo

Shows validity and information of SSH certificates

$ ssh-certinfo ~/.ssh/*.pub/home/vaporup/.ssh/id_rsa-cert.pub  SSH_CERT_VALID    forever              ->  forever/home/vaporup/.ssh/test1-cert.pub   SSH_CERT_INVALID  2038-01-19T04:14:07  ->  2038-01-19T04:14:07/home/vaporup/.ssh/test2-cert.pub   SSH_CERT_EXPIRED  1988-11-14T13:36:40  ->  1991-08-11T14:36:40
$ ssh-certinfo -v ~/.ssh/*.pub/home/vaporup/.ssh/id_rsa-cert.pub:        Type: ssh-rsa-cert-v01@openssh.com user certificate        Public key: RSA-CERT SHA256:Mm7o312345YEaWetVshTBslX48h0XJceLWzxx3RugDg        Signing CA: RSA SHA256:4fcOpOm/Xk12345mYnihk0cr6SdjghPgONxriMJex+A        Key ID: "vaporup"        Serial: 0        Valid: forever        Principals: (none)        Critical Options: (none)        Extensions:                permit-X11-forwarding                permit-agent-forwarding                permit-port-forwarding                permit-pty                permit-user-rc

ssh-force-password

Enforces password authentication (as long as the server allows it).
It became quite annoying googling the SSH options for this every time.
e.g. used to skip key-based login for password testing.

$ ssh-force-password kimvaporup@kim's password:

ssh-keyinfo

Prints keys in several formats

$ ssh-keyinfo ~/.ssh/*.pub(RSA)  2048     MD5 40:52:aa:14:a5:9a:fe:b5:96:c0:d2:dc:99:f1:a5:77  /home/vaporup/.ssh/id_rsa.pub(RSA)  2048  SHA256 V4F6ipY4gG83sQGM0eRk0+g1RWE9K4asDUj1jFpCa48      /home/vaporup/.ssh/id_rsa.pub

ssh-hostkeys

Prints server host keys in several formats

$ ssh-hostkeys kim  (ECDSA)   256     MD5 3d:8e:49:6e:40:34:c6:e4:c8:5f:60:d9:ad:bf:1f:b9  (ECDSA)   256  SHA256 txYpmPENBWolKBaA5EkCM/y1Hm2DP81jtABFrWUBf/c(ED25519)   256     MD5 a8:93:71:f9:13:d0:32:02:c0:e5:1e:f6:b9:db:8c:b0(ED25519)   256  SHA256 JZMLzNS2ifdGYv2SrqDodz7+/qaRCTBPukaCnMQqbX8    (RSA)  2048     MD5 8b:37:63:cd:58:fd:9c:18:93:08:3a:4c:84:64:87:91    (RSA)  2048  SHA256 WkOzD8BaeljejgTTAwECkByyb4kHdI0pnJB2/gcS1Lk

ssh-facts

Get some facts about the remote system

$ ssh-facts kimOS=ubuntuOS_VERSION=16.04UPTIME=7 days, 22 hours, 25 minutesLAST_REBOOT=Dec 20 19:34:27 2018CPU_CORES=2CPU_SOCKETS=2HOSTNAME=kimKERNEL_NAME=LinuxMACHINE=x86_64MACHINE_TYPE=virtual_by_kvmMEMORY=4045996INIT=systemdLSB_CODENAME=xenialLSB_DESCRIPTION=Ubuntu 16.04.5 LTSLSB_ID=UbuntuLSB_RELEASE=16.04

ssh-diff

Diff a file over SSH

$ ssh-diff /etc/hosts kimComparing kim:/etc/hosts (<) with /etc/hosts (>)1,2c1,2< 127.0.0.1 localhost< 127.0.1.1 kim---> 127.0.0.1 localhost> 127.0.1.1 blinky

ssh-version

Shows version of the SSH server you are connecting to

$ ssh-version kimRemote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.6

Packages

Packaging status

About

Making SSH more convenient

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp