From Things and Stuff Wiki
Jump to navigation Jump to search


ssh user@host

ssh user@host -p 123
 # specify alternate port

"Make sure you use full disk encryption and never stand up from your machine without locking it, and make sure you keep your local machine patched. If I get code execution on your machine, I am going to use whatever keys are loaded in your ssh-agent to pivot, hijack your existing open sessions, or modify your ssh client to dump the keys I need. ... Key length is a protection against the future, and against state level actors. Right now, key length doesn't matter much to me because I'm more focused on just stealing your keys from you regardless of length."



ssh -L 9384: remote-server

  • - Transparent proxy server that works as a poor man's VPN. Forwards over ssh. Doesn't require admin. Works with Linux and MacOS. Supports DNS tunneling.


See GUI#X Forwarding


Default file name format;

~/.ssh/id_rsa and ~/.ssh/
  RSA key
~/.ssh/identity and ~/.ssh/
  DSA key (old)


  create a key. rsa is default.


ssh-copy-id [-i [identity_file]] [user@]remote

ssh-copy-id ' -p 8129'

ssh-copy-id -i ~/.ssh/ '-p 221'

Multiple keys

ssh -i ~/.ssh/



 IdentityFile ~/.ssh/
  • sshit - A quick way to manage .ssh/config

SSH agent

  • Envoy helps you to manage ssh keys in similar fashion to keychain, but done in c, takes advantage of cgroups and systemd.

to sort





  • - a command line tool to manage your ssh connections. features; adding, editing, deleting, listing, searching across your SSHConfig. command alias support for your CLI preferences. support for custom SSH directives. scriptable as a python library. user interfaces besides cli. (web ui, wxpython, unity(ubuntu) indicator.) [10]


  • multissh - A really short but useful shellscript for connecting to all nodes of a cluster using ssh (also thru gateways and trapdoors) and sending commands to all nodes in parallel. It's using DCOP to remote-control a konsole process with the ssh connections in seperate tabs.


  • Teleport - Privileged access management for elastic infrastructure.
    • Teleport 1.0 Released - "For the uninitiated, Teleport is modern SSH server designed for clusters of servers and the teams working on them. The notion of “cluster” and cluster membership is central to Teleport: users can explore the nodes in a cluster, their user permissions are governed on a cluster level, etc. You can think of Teleport as a set of enhancements to SSH, while still being backward compatible with OpenSSH. You can think of Teleport as a set of enhancements to SSH, while still being backward compatible with OpenSSH."

Server and client


The OpenSSH suite consists of the following tools:

  • Remote operations are done using ssh, scp, and sftp.
  • Key management with ssh-add, ssh-keysign, ssh-keyscan, and ssh-keygen.
  • The service side consists of sshd, sftp-server, and ssh-agent.


  • Dropbear is a relatively small SSH server and client. It runs on a variety of POSIX-based platforms. Dropbear is open source software, distributed under a MIT-style license. Dropbear is particularly useful for "embedded"-type Linux (or other Unix) systems, such as wireless routers.



  • PuTTY - a free implementation of SSH and Telnet for Windows and Unix platforms, along with an xterm terminal emulator.

  • KiTTY - a fork from version 0.70 of PuTTY, the best telnet / SSH client in the world. KiTTY is only designed for the Microsoft® Windows® platform.



  • tinyssh - a minimalistic SSH server which implements only a subset of SSHv2 features.


  • - a Secure Shell fingerprint record is a type of resource record in the Domain Name System (DNS) which identifies SSH keys that are associated with a host name. The acquisition of an SSHFP record needs to be secured with a mechanism such as DNSSEC for a chain of trust to be established.




TOTP port fluxing


scp -P [port] file.txt user@remotehose:~/file.txt

When scp on remote is initiated, it done so with -t flag, which is undocumented but might be required for precise command persmission configuration.


sshfs user@address:/home/user/dir dirtomountto -p [port]

fusermount -u dirtomountto


fuse: failed to open /dev/fuse: Permission denied


usermod -G fuse [username]

and relogin


  • - stands for Secure Back Channel and is a little tool to help you using SSH sessions. It looks like bcvi but is more secure in the command execution process (it uses SSH and not a new non-crypted non-authenticated protocol) and is very flexible for plugin creation (you can create your plugin easily, using your preferred programming language). It is tested on GNU/Linux and Mac OS X as client machines and any UNIX-like server, with any shell. Example use case: sometimes when you are in a local-machine and connects via SSH to a remote-machine you need to copy some files between two machines, run some time-consuming commands and other things. sbc helps you in these tasks so you don't need to open other terminal windows/SSH sessions to do it or you can be notified when some tasks are done, for example.


To sort