ubuntu:ftp:connect_with_sftp
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ubuntu:ftp:connect_with_sftp [2019/11/29 14:18] – created peter | ubuntu:ftp:connect_with_sftp [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Ubuntu - FTP - Connect with SFTP ====== | ====== Ubuntu - FTP - Connect with SFTP ====== | ||
+ | <WRAP todo> | ||
TODO | TODO | ||
+ | </ | ||
+ | |||
By default, SFTP uses the SSH protocol to authenticate and establish a secure connection. | By default, SFTP uses the SSH protocol to authenticate and establish a secure connection. | ||
Line 27: | Line 30: | ||
---- | ---- | ||
- | We can establish | + | ===== Establish an SSH connection ===== |
+ | |||
+ | Establish | ||
<code bash> | <code bash> | ||
Line 39: | Line 44: | ||
===== Getting Help in SFTP ===== | ===== Getting Help in SFTP ===== | ||
- | The most useful command to learn first is the help command. This gives you access to a summary of the SFTP help. You can call it by typing either of these in the prompt: | + | The most useful command to learn first is the **help** command. |
+ | |||
+ | This gives you access to a summary of the SFTP help. | ||
+ | |||
+ | You can call it by typing either of these in the prompt: | ||
<code bash> | <code bash> | ||
help | help | ||
+ | </ | ||
+ | |||
+ | or | ||
+ | |||
+ | <code bash> | ||
? | ? | ||
</ | </ | ||
Line 73: | Line 87: | ||
We can navigate through the remote system' | We can navigate through the remote system' | ||
- | First, let's orient ourselves by finding out which directory we are in currently on the remote system. Just like in a typical shell session, we can type the following to get the current directory: | + | First, let's orient ourselves by finding out which directory we are in currently on the remote system. |
+ | |||
+ | Just like in a typical shell session, we can type the following to get the current directory: | ||
<code bash> | <code bash> | ||
Line 80: | Line 96: | ||
Remote working directory: / | Remote working directory: / | ||
+ | |||
+ | ---- | ||
+ | |||
We can view the contents of the current directory of the remote system with another familiar command: | We can view the contents of the current directory of the remote system with another familiar command: | ||
Line 121: | Line 140: | ||
</ | </ | ||
- | We can now traverse the remote file system, but what if we need to access our local file system? We can direct commands towards the local file system by preceding them with an "l" | + | We can now traverse the remote file system, but what if we need to access our local file system? |
+ | |||
+ | We can direct commands towards the local file system by preceding them with an **l** for local. | ||
---- | ---- | ||
- | All of the commands discussed so far have local equivalents. We can print the local working directory: | + | All of the commands discussed so far have local equivalents. |
+ | |||
+ | We can print the local working directory: | ||
<code bash> | <code bash> | ||
Line 157: | Line 180: | ||
- | Transferring Files with SFTP | + | ---- |
+ | |||
+ | ===== Transferring Files with SFTP ===== | ||
Navigating the remote and local filesystems is of limited usefulness without being able to transfer files between the two. | Navigating the remote and local filesystems is of limited usefulness without being able to transfer files between the two. | ||
- | ---- | + | ==== Transferring Remote Files to the Local System ==== |
- | + | ||
- | ===== Transferring Remote Files to the Local System | + | |
If we would like download files from our remote host, we can do so by issuing the following command: | If we would like download files from our remote host, we can do so by issuing the following command: | ||
Line 189: | Line 212: | ||
---- | ---- | ||
+ | |||
The " | The " | ||
Line 202: | Line 226: | ||
get -Pr someDirectory | get -Pr someDirectory | ||
</ | </ | ||
+ | |||
+ | ---- | ||
==== Transferring Local Files to the Remote System ==== | ==== Transferring Local Files to the Remote System ==== | ||
Line 240: | Line 266: | ||
</ | </ | ||
- | shows: | + | returns: |
<code bash> | <code bash> | ||
Line 256: | Line 282: | ||
</ | </ | ||
- | shows: | + | returns: |
<code bash> | <code bash> | ||
Line 290: | Line 316: | ||
</ | </ | ||
- | Notice how, unlike the system " | + | Notice how, unlike the system " |
+ | |||
+ | Unfortunately, | ||
An involved work around could be accomplished with: | An involved work around could be accomplished with: | ||
Line 299: | Line 327: | ||
</ | </ | ||
- | shows: | + | returns: |
<code bash> | <code bash> | ||
Line 324: | Line 352: | ||
</ | </ | ||
- | Again, there is no easy way to get a listing of the remote system' | + | Again, there is no easy way to get a listing of the remote system' |
+ | |||
+ | We can work around it with the following command: | ||
<code bash> | <code bash> | ||
Line 331: | Line 361: | ||
</ | </ | ||
- | displays: | + | returns: |
<code bash> | <code bash> | ||
Line 416: | Line 446: | ||
https:// | https:// | ||
+ |
ubuntu/ftp/connect_with_sftp.1575037089.txt.gz · Last modified: 2020/07/15 09:30 (external edit)