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


Groups > comp.lang.python > #82129 > unrolled thread

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

Started byishish <ishish@domhain.de>
First post2014-12-08 17:37 +0000
Last post2014-12-08 20:23 -0500
Articles 10 — 8 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: why can't download file from linux server into local window disk c:? ishish <ishish@domhain.de> - 2014-12-08 17:37 +0000
    Re: why can't download file from linux server into local window disk c:? Luuk <luuk@invalid.lan> - 2014-12-08 19:11 +0100
      Re: why can't download file from linux server into local window disk c:? Chris Angelico <rosuav@gmail.com> - 2014-12-09 05:18 +1100
      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:37 +0100
      Re: why can't download file from linux server into local window disk c:? Tim Chase <python.list@tim.thechases.com> - 2014-12-08 12:32 -0600
    Re: why can't download file from linux server into local window disk c:? Luuk <luuk34@gmail.com> - 2014-12-08 19:11 +0100
      Re: why can't download file from linux server into local window disk c:? alister <alister.nospam.ware@ntlworld.com> - 2014-12-08 18:46 +0000
        Re: why can't download file from linux server into local window disk c:? Tim Chase <python.list@tim.thechases.com> - 2014-12-08 13:50 -0600
        Re: why can't download file from linux server into local window disk c:? Chris Angelico <rosuav@gmail.com> - 2014-12-09 07:16 +1100
        Re: why can't download file from linux server into local window disk c:? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-08 20:23 -0500

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

Fromishish <ishish@domhain.de>
Date2014-12-08 17:37 +0000
SubjectRe: why can't download file from linux server into local window disk c:?
Message-ID<mailman.16726.1418061662.18130.python-list@python.org>
>     with open(localpath, 'wb') as fl:
> PermissionError: [Errno 13] Permission denied: 'c:'

I remember gloomily (haven't used windows since ages) that newer 
Windows versions don't like users to write directly to C:. Have you 
tried to save the file to your Documents folder?

Regards,
Alba

[toc] | [next] | [standalone]


#82130

FromLuuk <luuk@invalid.lan>
Date2014-12-08 19:11 +0100
Message-ID<5485E9DC.6000509@invalid.lan>
In reply to#82129
On 8-12-2014 18:37, ishish wrote:
>>     with open(localpath, 'wb') as fl:
>> PermissionError: [Errno 13] Permission denied: 'c:'
>
> I remember gloomily (haven't used windows since ages) that newer Windows
> versions don't like users to write directly to C:. Have you tried to
> save the file to your Documents folder?
>
> Regards,
> Alba

no, it's the ssh-server denying a log on from 'root'

[toc] | [prev] | [next] | [standalone]


#82132

FromChris Angelico <rosuav@gmail.com>
Date2014-12-09 05:18 +1100
Message-ID<mailman.16728.1418062739.18130.python-list@python.org>
In reply to#82130
On Tue, Dec 9, 2014 at 5:11 AM, Luuk <luuk34@gmail.com> wrote:
> On 8-12-2014 18:37, ishish wrote:
>>>
>>>     with open(localpath, 'wb') as fl:
>>> PermissionError: [Errno 13] Permission denied: 'c:'
>>
>>
>> I remember gloomily (haven't used windows since ages) that newer Windows
>> versions don't like users to write directly to C:. Have you tried to
>> save the file to your Documents folder?
>>
>> Regards,
>> Alba
>
>
> no, it's the ssh-server denying a log on from 'root'

It looks to me more like an issue with path naming. Try 'c:/' instead
of 'c:', or use '/' to mean the root directory of the current drive.
Alternatively, do a web search for the problem and the symptoms, as
you're unlikely to be the first person to have run into this.

ChrisA

[toc] | [prev] | [next] | [standalone]


#82140

FromThomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de>
Date2014-12-08 20:37 +0100
Message-ID<m64umd$ub8$1@r01.glglgl.de>
In reply to#82130
Am 08.12.2014 19:11 schrieb Luuk:

> no, it's the ssh-server denying a log on from 'root'

You are repating yourself.

How could possibly

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

be a problem with the SSH server?

[toc] | [prev] | [next] | [standalone]


#82141

FromTim Chase <python.list@tim.thechases.com>
Date2014-12-08 12:32 -0600
Message-ID<mailman.16732.1418068062.18130.python-list@python.org>
In reply to#82130
On 2014-12-08 19:11, Luuk wrote:
> On 8-12-2014 18:37, ishish wrote:
> >>     with open(localpath, 'wb') as fl:
> >> PermissionError: [Errno 13] Permission denied: 'c:'
> >
> > I remember gloomily (haven't used windows since ages) that newer
> > Windows versions don't like users to write directly to C:. Have
> > you tried to save the file to your Documents folder?
> >
> > Regards,
> > Alba
> 
> no, it's the ssh-server denying a log on from 'root'

I'm going to go out on a limb and say that's pretty clearly not the
issue.  The exception states that the problem is one of permissions
on the C:

  PermissionError: [Errno 13] Permission denied: 'c:'

which ishish clearly identified as a "Windows doesn't let you do that
any more" issue.  Additionally, I don't know off the top of my if the
Paramiko libraries expect a file-name, or if they expect a directory
into which the file gets put based on the server-side name.

The best solution is to do as ishish proposed: write the file to some
other appropriate (i.e., writable) location.  A simple fix might be

  import os
  # ...
  localpath = os.path.expanduser('~')

or

  localpath = os.path.join(
    os.path.expanduser('~'),
    'passwd.txt',
    )

A stop-gap solution might be to just run the program in a writable
directory:

  c:\> cd %TEMP%
  c:\...\TEMP> python myprog.py

A far worse solution would be to run the script as Administrator on
the Win32 box, which will grant permission to write in the root of C:

-tkc


[toc] | [prev] | [next] | [standalone]


#82131

FromLuuk <luuk34@gmail.com>
Date2014-12-08 19:11 +0100
Message-ID<mailman.16727.1418062309.18130.python-list@python.org>
In reply to#82129
On 8-12-2014 18:37, ishish wrote:
>>     with open(localpath, 'wb') as fl:
>> PermissionError: [Errno 13] Permission denied: 'c:'
>
> I remember gloomily (haven't used windows since ages) that newer Windows
> versions don't like users to write directly to C:. Have you tried to
> save the file to your Documents folder?
>
> Regards,
> Alba

no, it's the ssh-server denying a log on from 'root'

[toc] | [prev] | [next] | [standalone]


#82136

Fromalister <alister.nospam.ware@ntlworld.com>
Date2014-12-08 18:46 +0000
Message-ID<6mmhw.29670$5z5.10496@fx42.am4>
In reply to#82131
On Mon, 08 Dec 2014 19:11:40 +0100, Luuk wrote:

> On 8-12-2014 18:37, ishish wrote:
>>>     with open(localpath, 'wb') as fl:
>>> PermissionError: [Errno 13] Permission denied: 'c:'
>>
>> I remember gloomily (haven't used windows since ages) that newer
>> Windows versions don't like users to write directly to C:. Have you
>> tried to save the file to your Documents folder?
>>
>> Regards,
>> Alba
> 
> no, it's the ssh-server denying a log on from 'root'

windows systems dont usualy have an SSH server & root is not a normal 
windows user name

on most systems that DO have a ssh server root logins are usually 
prohibited, either enable root logins (dangerous) or log in with a user 
that has permissions to do what you require. if you don't have access to 
the server then you need assistance from someone who is authorised.






-- 
Do you know Montana?

[toc] | [prev] | [next] | [standalone]


#82142

FromTim Chase <python.list@tim.thechases.com>
Date2014-12-08 13:50 -0600
Message-ID<mailman.16733.1418068108.18130.python-list@python.org>
In reply to#82136
On 2014-12-08 18:46, alister wrote:
> on most systems that DO have a ssh server root logins are usually 
> prohibited, either enable root logins (dangerous) or log in with a
> user that has permissions to do what you require. if you don't have
> access to the server then you need assistance from someone who is
> authorised.

Just for the record, you can enable root logins but disallow password
logins, so root has to be done with a public/private key-pair.

That said, I do as you describe and still SSH to my ssh-user account,
then "su" to root as needed from there.  But at least there's a
middle ground that isn't as vulnerable as putting a root account out
there to be banged on by any script-o-matic bot that finds it.

I also like to change my external SSH port to something
non-traditional (and have configured port-knocking in the past) to
prevent the obvious pokes I would otherwise see in my sshd/auth/access
logs.

-tkc

[toc] | [prev] | [next] | [standalone]


#82144

FromChris Angelico <rosuav@gmail.com>
Date2014-12-09 07:16 +1100
Message-ID<mailman.16734.1418069791.18130.python-list@python.org>
In reply to#82136
On Tue, Dec 9, 2014 at 6:50 AM, Tim Chase <python.list@tim.thechases.com> wrote:
> Just for the record, you can enable root logins but disallow password
> logins, so root has to be done with a public/private key-pair.
>
> That said, I do as you describe and still SSH to my ssh-user account,
> then "su" to root as needed from there.  But at least there's a
> middle ground that isn't as vulnerable as putting a root account out
> there to be banged on by any script-o-matic bot that finds it.

I've done both of these. Most of my boxes don't have passwords on the
root account AND don't allow SSH to root, relying on a sudo-enabled
account usually; and it's perfectly possible to also deny password
access to *any* account via SSH. Quite good for security... though it
can create an awkward bootstrap problem if you lose all private keys
that had access.

ChrisA

[toc] | [prev] | [next] | [standalone]


#82166

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2014-12-08 20:23 -0500
Message-ID<mailman.16750.1418088236.18130.python-list@python.org>
In reply to#82136
On Mon, 08 Dec 2014 18:46:26 GMT, alister
<alister.nospam.ware@ntlworld.com> declaimed the following:


>windows systems dont usualy have an SSH server & root is not a normal 
>windows user name
>
	It's the name of my admin account going back to my first WinXP
machine...
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web