My Emacs settings
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
481 B

3 years ago
3 years ago
  1. (defun tunnel (port host)
  2. (interactive "sPort: \nsHost: ")
  3. (let ((buffer "SSH Tunnel"))
  4. (async-shell-command
  5. (concat "ssh -C -N -D " port " " host)
  6. buffer)
  7. (with-current-buffer buffer
  8. (insert (concat "Starting tunnel on " host " port " port)))))
  9. (defun sshuttle-tunnel (host)
  10. (interactive "suser@host: ")
  11. (let ((buffer "sshuttle"))
  12. (async-shell-command
  13. (format "sudo sshuttle --dns -r %s 0.0.0.0/0" host)
  14. buffer)))
  15. (provide 'tunnel)