tutorials:remote_access
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorials:remote_access [2011/02/01 02:52] – [ssh] chkuo | tutorials:remote_access [2019/01/11 17:35] (current) – [Key] chkuo | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Remote access ====== | ====== Remote access ====== | ||
| - | ===== ssh ===== | + | ===== SSH ===== |
| - | ==== Log-in | + | |
| + | ==== Login ==== | ||
| '' | '' | ||
| Line 16: | Line 17: | ||
| You will return to the shell running on your local machine, just like before you logging into the remote server. | You will return to the shell running on your local machine, just like before you logging into the remote server. | ||
| - | ==== ssh key ==== | + | ==== Key ==== |
| - | To generate key-pairs, use: <code bash> | + | To generate key-pairs, use: <code bash> |
| - | This command will create a pair of private key ('' | + | This command will create a pair of private key ('' |
| + | If the home directory is encrypted, '' | ||
| + | For example (see [[https:// | ||
| + | * set up ''/ | ||
| + | * in ''/ | ||
| + | * restart sshd: '' | ||
| - | ===== scp ===== | + | ==== Keep alive ==== |
| - | '' | + | To prevent the ssh sessions from being disconnected due to inactivity, add the following lines to '' |
| - | + | < | |
| - | For example, to copy a file (foo.txt) from the home directory (~) to the home directory in the remote server, use: | + | ServerAliveInterval 60 |
| - | < | + | ServerAliveCountMax 60 |
| - | $ scp ~/foo.txt 168.192.1.1: | + | |
| </ | </ | ||
| + | This sends a signal every 60 seconds for a maximum of 60 times (one hour) from the client to the server. | ||
| - | Reversely, to copy the file from the remote server back to the local workstation: | + | If you do not have the permission to make this modification, |
| - | <code bash> | + | |
| - | $ scp 168.192.1.1: | + | |
| - | </ | + | ===== SCP ===== |
| + | '' | ||
| + | |||
| + | Similar to the example in ssh, the username can be omitted if it is the same in the two hosts; in addition, the local host can be omitted as well. | ||
| + | |||
| + | For example, to copy a file (foo.txt) from the home directory (~) of the local workstation to the home directory in the remote server, use: <code bash>scp ~/foo.txt 168.192.1.1: | ||
| + | |||
| + | Reversely, to copy the file from the remote server back to the local workstation, use: <code bash>scp 168.192.1.1: | ||
| Some commonly used options include: | Some commonly used options include: | ||
| Line 39: | Line 52: | ||
| * '' | * '' | ||
| - | For example, to preserve the property of the file being copied, use: | + | For example, to preserve the property of the file being copied, use: <code bash>scp -p ~/foo.txt 168.192.1.1: |
| - | <code bash> | + | |
| - | $ scp -p ~/foo.txt 168.192.1.1: | + | |
| - | </ | + | |
| - | + | ||
| - | To copy an entire directory: | + | |
| - | <code bash> | + | |
| - | $ scp -r ~/foo_dir 168.192.1.1: | + | |
| - | </ | + | |
| + | To copy an entire directory, use: <code bash>scp -r ~/foo_dir 168.192.1.1: | ||
tutorials/remote_access.1296499974.txt.gz · Last modified: by chkuo