Path: csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!news.astraweb.com!border5.a.newsrouter.astraweb.com!not-for-mail From: "Luuk" To: pengsir Subject: Re: why can't download file from linux server into local window disk c: Message-ID: <54866F2E.1745.complang@piz.noip.com> X-Comment-To: pengsir Newsgroups: comp.lang.python In-Reply-To: <54866F2E.1744.complang@piz.noip.com> References: <54866F2E.1744.complang@piz.noip.com> X-FTN-AREA: COMP.LANG.PYTHON X-FTN-PID: SoupGate-Win32 v1.05 X-FTN-MSGID: <5485d3c8$0$2832$e4fe514c@news.xs4all.nl> d51d239f X-FTN-REPLY: d31fc52f Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: piz.noip.com [Synchronet 3.15b-Win32 NewsLink 1.92] X-Server: piz.noip.me Date: 9 Dec 2014 11:32:00 -0500 Lines: 39 Organization: Unlimited download news at news.astraweb.com NNTP-Posting-Host: 2266ad8f.news.astraweb.com X-Trace: DXC=LP`[=a9Aa>5J5c6\GR85Z>L?0kYOcDh@:RScV177L_P1Zh[e@ZS;QS3l23]GVn`Zm6MHo6fPSBkU;04hIVDTD?[;7g\XjYcGeh9fPiGS6_2a\= Xref: csiph.com comp.lang.python:82207 To: pengsir On 9-12-2014 09:14, pengsir wrote: > > > 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:' You, 'root', does not have enoug permission to do it.... C:\temp>\util\Putty\pscp root@opensuse:/etc/passwd . Using keyboard-interactive authentication. Password: Access denied --- SoupGate-Win32 v1.05 * Origin: NNTP.gateway.@.piz.noip.me> (1:249/999) --- Synchronet 3.15b-Win32 NewsLink 1.92 SpaceSST BBS Usenet <> Fidonet Gateway