简体   繁体   中英

Access local file from ipython on ec2

I am using an ipython notebook on an ec2 instance. I want to read a file sitting on my local machine. Is that possible, or should I push the file onto the ec2 box (eg via an s3 mount)

Just to clarify... It sounds like you have connected to an Amazon EC2 Linux instance via SSH and you are using iPython Notebook on that instance. You would like Python to access a file on your local computer (from which you initiated the SSH session).

Is this correct?

This is not possible through a standard SSH session. No disks are shared across SSH.

You could use scp from your local computer to copy a file to the remote Linux instance.

Alternatively, you could copy files via Amazon S3. Install the AWS Command-Line Interface (CLI) on your local computer, then use the aws s3 cp command to copy the file to S3. Then, use the same command to copy the file from S3 to your EC2 instance (effectively using S3 as a central file repository).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM