0

I'm trying to write a script that transfers files from/to sftp on an Unix server, creates directories and takes a list of files on sftp in the same format for time stamp/file name/file size.

It's my first experience with Python. Also I have the limitation: I have to use only standard library without Paramiko etc. Input parameters: host, port user name / pass, path.

How to establish a connection using login/pass?

halfer
  • 19,824
  • 17
  • 99
  • 186
Vova Lis
  • 21
  • 3
  • *why* can you only use the standard library? that seems pretty steep. – MattR Feb 19 '18 at 19:23
  • because I have limited access to the server of my client – Vova Lis Feb 19 '18 at 19:31
  • Is starting system/shell apps an option? If so you should take a look into [subprocess](https://docs.python.org/2/library/subprocess.html) or even better [here](https://stackoverflow.com/questions/89228) – Lohmar ASHAR Feb 19 '18 at 19:33
  • yes I can use subprocess – Vova Lis Feb 19 '18 at 19:40
  • Then follow the second link, points to another question here on stackoverflow, it will provide various useful details. – Lohmar ASHAR Feb 19 '18 at 19:45
  • Possible duplicate of [Calling an external command in Python](https://stackoverflow.com/questions/89228/calling-an-external-command-in-python) – Lohmar ASHAR Feb 19 '18 at 19:46
  • 1
    1. Get a recent version of Python. 2. Put it somewhere in your home. 3. Get the newest version of `pip`. 4. Create a virtual environment in your home. 5. Install all libs you need in the environment with `pip`. 6. Be more happy. – Klaus D. Feb 19 '18 at 19:50
  • Thanks. Problem is that I will often do such manipulations with installing libs because servers have restore points – Vova Lis Feb 19 '18 at 20:12

0 Answers0