cs:ssh
Return to Home page
If you found any error, or if you want to partecipate to the editing of this wiki, please contact: admin [at] skenz.it
You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url: https://www.skenz.it/cs/ssh?do=diff&rev=1488553240&difftype=sidebyside
Differences
This shows you the differences between two versions of the page.
— | cs:ssh [2024/04/08 22:35] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== SSH ====== | ||
+ | ===== SSH login without password ===== | ||
+ | Generate a public and private key for a machine: | ||
+ | <code bash> | ||
+ | ssh-keygen -t rsa | ||
+ | </ | ||
+ | do not put password. Private and public keys are stored in // | ||
+ | Copy public key in the remote machine with the command: | ||
+ | <code bash> | ||
+ | cat ~/ | ||
+ | </ | ||
+ | |||
+ | Now login can be performed directly without password. | ||
+ | |||
+ | Remember that in the remote host correct permissions are '' | ||
+ | |||
+ | ===== Reverse SSH tunneling ===== | ||
+ | There are two PCs, the //client// behind a NAT and the //server// with a public IP address. We want to access the //client// from the //server//. | ||
+ | |||
+ | We can follow the following steps: | ||
+ | * Exchange keys in order to allow the //client// to login into the //server// without typing a password. | ||
+ | * Add in the file /// | ||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | su -c " | ||
+ | </ | ||
+ | that are runed on startup and allow the access to the //client// with the command: | ||
+ | <code bash> | ||
+ | ssh < | ||
+ | </ | ||
+ | * Give to the file the execution permission: | ||
+ | <code bash> | ||
+ | sudo chmod +x / | ||
+ | </ | ||
+ | |||
+ | The //client// must have the ability to connect with the //server// without password. To this extent follow the guide "SSH login without password" |
If you found any error, or if you want to partecipate to the editing of this wiki, please contact: admin [at] skenz.it
You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url: https://www.skenz.it/cs/ssh?do=diff&rev=1488553240&difftype=sidebyside