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:57] – chkuo | tutorials:remote_access [2019/01/11 17:35] (current) – [Key] chkuo | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== SSH ===== | ===== SSH ===== | ||
| + | |||
| ==== Login ==== | ==== Login ==== | ||
| '' | '' | ||
| Line 17: | Line 18: | ||
| ==== 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: '' | ||
| + | |||
| + | ==== Keep alive ==== | ||
| + | To prevent the ssh sessions from being disconnected due to inactivity, add the following lines to ''/ | ||
| + | < | ||
| + | ServerAliveInterval 60 | ||
| + | ServerAliveCountMax 60 | ||
| + | </ | ||
| + | This sends a signal every 60 seconds for a maximum of 60 times (one hour) from the client to the server. | ||
| + | |||
| + | If you do not have the permission to make this modification, | ||
| Line 27: | Line 44: | ||
| 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. | 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 (~) to the home directory in the remote server, use: <code bash>scp ~/foo.txt 168.192.1.1: | + | For example, to copy a file (foo.txt) from the home directory (~) of the local workstation |
| - | Reversely, to copy the file from the remote server back to the local workstation: | + | 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 37: | Line 54: | ||
| For example, to preserve the property of the file being copied, use: <code bash>scp -p ~/foo.txt 168.192.1.1: | For example, to preserve the property of the file being copied, use: <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.1296500241.txt.gz · Last modified: by chkuo