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

2014-12-08 Thread pengsir



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 "", line 1, in 
  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:'
--
https://mail.python.org/mailman/listinfo/python-list


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

2014-12-08 Thread pengsir

It's trying to open the file 'c:', but that's not a file, it's a folder.

Try, say, 'c:/passwd' instead.


It works for me, i tried ,it is ok .

--
https://mail.python.org/mailman/listinfo/python-list


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

2014-12-09 Thread pengsir
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 "", line 1, in 
   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:'

--- SoupGate-Win32 v1.05
 * Origin: nntp.gatew...@.piz.noip.me> (1:249/999)
--- Synchronet 3.15b-Win32 NewsLink 1.92
SpaceSST BBS Usenet <> Fidonet Gateway
-- 
https://mail.python.org/mailman/listinfo/python-list


how can i get the file on my local pc from vps ip with paramiko or by some other way?

2014-12-17 Thread pengsir
I have an vps ,my local pc is in the local area network. When paramiko 
installed on my local pc ,i can get file from my vps.


import paramiko
t = paramiko.Transport(("vps ip",22))
t.connect(username = "username", password = "key")
sftp = paramiko.SFTPClient.from_transport(t)
remotepath='/tmp/test.txt'
localpath='/tmp/test.txt'
sftp.get(remotepath,localpath)

Now the problem is :how can i get the file on my local pc from vps ip 
with paramiko or by some other way?


--
https://mail.python.org/mailman/listinfo/python-list