linux:ssh
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:ssh [2013/09/07 07:33] – external edit 127.0.0.1 | linux:ssh [2017/12/15 13:22] (current) – [multiple ssh keys] percy | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| Forward the local port 8080 to the remote server 8080,so you can visit the local server via the remote server. | Forward the local port 8080 to the remote server 8080,so you can visit the local server via the remote server. | ||
| ssh -R : | ssh -R : | ||
| + | | ||
| + | | ||
| + | | ||
| + | ====== ssh auto login ====== | ||
| + | | ||
| + | http:// | ||
| + | | ||
| + | ===== ssh key generate ===== | ||
| + | Apps-iMac: | ||
| + | < | ||
| + | Generating public/ | ||
| + | Enter file in which to save the key (/ | ||
| + | Enter passphrase (empty for no passphrase): | ||
| + | Enter same passphrase again: | ||
| + | Your identification has been saved in digitalocean_rsa. | ||
| + | Your public key has been saved in digitalocean_rsa.pub. | ||
| + | The key fingerprint is: | ||
| + | ec: | ||
| + | The key's randomart image is: | ||
| + | +--[ RSA 2048]----+ | ||
| + | |..++ . | | ||
| + | |.* = . | | ||
| + | |o.++.. | ||
| + | | .+o.E . | | ||
| + | |. oo S | | ||
| + | | o. . . | | ||
| + | | . o . | | ||
| + | | . o . | | ||
| + | | | ||
| + | +-----------------+ | ||
| + | </ | ||
| + | |||
| + | Then get the pub key | ||
| + | cat digitalocean_rsa.pub | ||
| + | |||
| + | Add it to the server side | ||
| + | root@pjq:~# vim ~/ | ||
| + | | ||
| + | ====== multiple ssh keys ====== | ||
| + | Sometimes we will have many different ssh keys, so need config it to support different keys. | ||
| + | | ||
| + | touch ~/ | ||
| + | Apps-iMac: | ||
| + | < | ||
| + | Host ef.pjq.me | ||
| + | IdentityFile ~/ | ||
| + | User root | ||
| + | </ | ||
| + | |||
| + | so finally the config will be like this | ||
| + | < | ||
| + | Host ef.pjq.me | ||
| + | IdentityFile ~/ | ||
| + | User root | ||
| + | |||
| + | Host aliyun.pjq.me | ||
| + | IdentityFile ~/ | ||
| + | User root | ||
| + | |||
| + | Host vps.pjq.me | ||
| + | IdentityFile ~/ | ||
| + | User root | ||
| + | </ | ||
| + | |||
| + | - Refer https:// | ||
| + | ====== ssh socks 5 ====== | ||
| + | ssh -qTfnN -D 7070 root@vps.pjq.me -p 2222 | ||
/var/www/dokuwiki/wiki/data/attic/linux/ssh.1378510411.txt.gz · Last modified: 2016/05/05 13:06 (external edit)
