ubuntu:ftp:connect_with_sftp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ubuntu:ftp:connect_with_sftp [2019/11/29 14:18] – created peterubuntu: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
 +</WRAP>
 +
  
 By default, SFTP uses the SSH protocol to authenticate and establish a secure connection.  Because of this, the same authentication methods are available that are present in SSH. By default, SFTP uses the SSH protocol to authenticate and establish a secure connection.  Because of this, the same authentication methods are available that are present in SSH.
Line 27: Line 30:
 ---- ----
  
-We can establish an SSH connection and then open up an SFTP session using that connection by issuing the following command:+===== Establish an SSH connection ===== 
 + 
 +Establish an SSH connection and then open up an SFTP session using that connection by issuing the following command:
  
 <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
 +</code>
 +
 +or
 +
 +<code bash>
 ? ?
 </code> </code>
Line 73: Line 87:
 We can navigate through the remote system's file hierarchy using a number of commands that function similarly to their shell counterparts. We can navigate through the remote system's file hierarchy using a number of commands that function similarly to their shell counterparts.
  
-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: /home/demouser Remote working directory: /home/demouser
 +
 +----
 +
 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:
 </code> </code>
  
-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 "lfor local.+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 "get" command also takes some option flags. For instance, we can copy a directory and all of its contents by specifying the recursive option: The "get" command also takes some option flags. For instance, we can copy a directory and all of its contents by specifying the recursive option:
  
Line 202: Line 226:
 get -Pr someDirectory get -Pr someDirectory
 </code> </code>
 +
 +----
  
 ==== Transferring Local Files to the Remote System ==== ==== Transferring Local Files to the Remote System ====
Line 240: Line 266:
 </code> </code>
  
-shows:+returns:
  
 <code bash> <code bash>
Line 256: Line 282:
 </code> </code>
  
-shows:+returns:
  
 <code bash> <code bash>
Line 290: Line 316:
 </code> </code>
  
-Notice how, unlike the system "chmod" command, the SFTP command does not accept usernames, but instead uses UIDs. Unfortunately, there is no easy way to know the appropriate UID from within the SFTP interface.+Notice how, unlike the system "chmod" command, the SFTP command does not accept usernames, but instead uses UIDs. 
 + 
 +Unfortunately, there is no easy way to know the appropriate UID from within the SFTP interface.
  
 An involved work around could be accomplished with: An involved work around could be accomplished with:
Line 299: Line 327:
 </code> </code>
  
-shows:+returns:
  
 <code bash> <code bash>
Line 324: Line 352:
 </code> </code>
  
-Again, there is no easy way to get a listing of the remote system's groups. We can work around it with the following command:+Again, there is no easy way to get a listing of the remote system's groups.  
 + 
 +We can work around it with the following command:
  
 <code bash> <code bash>
Line 331: Line 361:
 </code> </code>
  
-displays:+returns:
  
 <code bash> <code bash>
Line 416: Line 446:
  
 https://www.digitalocean.com/community/tutorials/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server https://www.digitalocean.com/community/tutorials/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server
 +
ubuntu/ftp/connect_with_sftp.1575037089.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki