01-30-2021

https://youtu.be/cEL7MmeOSic

 

 

SFTP- SSH File Transfer Protocol

 

-          Use case for this SFTP - Application team to copy data back and forth

-          Clone base image

 

Directory:

Config file:

Port #:

Package: openssh-server;

Services: sshd;

Protocol: TCP;

Command: yum; systemctl; sftp

URL:

 

SFTP Server – 192.168.56.129

 

[root@zmpt01 ~]# yum install openssh-server –y

 

[root@zmpt01 ~]# systemctl start sshd

[root@zmpt01 ~]# systemctl enable sshd

 

Add user

 

[root@zmpt01 ~]# id terminator

uid=1000(terminator) gid=9000(machine) groups=9000(machine),10(wheel)

 

Done with configuration of server

 

 

Client: 192.168.56.117

 

[root@client01 ~]# which sftp

/usr/bin/sftp

 

Log in as non-root user

 

 [terminator@client01 ~]$ sftp terminator@192.168.56.129

The authenticity of host '192.168.56.129 (192.168.56.129)' can't be established.

ECDSA key fingerprint is SHA256:e3LN1URGQEPwXaMbDeo+aTYev2cOOWnP3WKmaRG9gRU.

ECDSA key fingerprint is MD5:de:11:30:dd:ef:9e:ae:0a:ab:49:16:29:c9:08:36:8f.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.56.129' (ECDSA) to the list of known hosts.

terminator@192.168.56.129's password:

Connected to 192.168.56.129.

sftp>      < --- This is a restricted CLI for user

 

 

SFTP Commands

 

bye                               

Quit sftp

cd path                           

Change remote directory to 'path'

chgrp grp path                    

Change group of file 'path' to 'grp'

chmod mode path                   

Change permissions of file 'path' to 'mode'

chown own path                    

Change owner of file 'path' to 'own'

df [-hi] [path]                    

Display statistics for current directory or filesystem containing 'path'

                                  

exit                              

Quit sftp

get [-afPpRr] remote [local]       

Download file

reget [-fPpRr] remote [local]      

Resume download file

reput [-fPpRr] [local] remote     

Resume upload file

help                              

Display this help text

lcd path                          

Change local directory to 'path'

lls [ls-options [path]]            

Display local directory listing

lmkdir path                       

Create local directory

ln [-s] oldpath newpath           

Link remote file (-s for symlink)

lpwd                              

Print local working directory

ls [-1afhlnrSt] [path]             

Display remote directory listing

lumask umask                      

Set local umask to 'umask'

mkdir path                        

Create remote directory

progress                          

Toggle display of progress meter

put [-afPpRr] local [remote]       

Upload file

pwd                               

Display remote working directory

quit                              

Quit sftp

rename oldpath newpath            

Rename remote file

rm path                           

Delete remote file

rmdir path                        

Remove remote directory

symlink oldpath newpath           

Symlink remote file

version                            

Show SFTP version

!command                          

Execute 'command' in local shell

!                                 

Escape to local shell

?                                 

Synonym for help