Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82125

why can't download file from linux server into local window disk c:?

Date 2014-12-09 00:14 -0800
From pengsir <elearn2014@gmail.com>
Subject why can't download file from linux server into local window disk c:?
Newsgroups comp.lang.python
Message-ID <mailman.16725.1418055279.18130.python-list@python.org> (permalink)

Show all headers | View raw



My vps ip is x.y.z.w ,i want to download /etc/passwd from linux server  
into my local window disk c: .

import paramiko
host = "x.y.z.w"
port = 22
transport = paramiko.Transport((host, port))
password = "mykey"
username = "root"
transport.connect(username = username, password = password)
sftp = paramiko.SFTPClient.from_transport(transport)
filepath = '/etc/passwd'
localpath = 'c:'
sftp.get(filepath, localpath)

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "D:\Python34\lib\site-packages\paramiko\sftp_client.py", line 
719, in get

     with open(localpath, 'wb') as fl:
PermissionError: [Errno 13] Permission denied: 'c:'

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

why can't download file from linux server into local window disk c:? pengsir <elearn2014@gmail.com> - 2014-12-09 00:14 -0800
  Re: why can't download file from linux server into local window disk c:? Luuk <luuk@invalid.lan> - 2014-12-08 17:37 +0100
  Re: why can't download file from linux server into local window disk c:? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2014-12-08 20:36 +0100
  Re: why can't download file from linux server into local window disk c:? Nobody <nobody@nowhere.invalid> - 2014-12-08 22:25 +0000

csiph-web