How to create directory in remote system using python script

624 Views Asked by At

I want to create a directory in my remote system using python script or by socket programming. I have remote system's Username, password and IP address. I am able to do this in my local machine but not in remote. Please help!

2

There are 2 best solutions below

4
On

Download Putty then connect to remote system) and in terminal write mkdir foldername

0
On

To create a directory on a remote machine, you will have to first connect to it.Telnet and SSH and SSH is used to connect to remote machines. Obviously TELNET or SSH service should be running on the remote machine, otherwise you won't be able to connect.Since in case of Telnet,data is transfered in plain text, it's better to use SSH protocol.

Once connected to the remote machine using SSH, you will be able to execute commands on the remote machine.

Now since you want to do everything in Python, you will have to write a complete SSH client in Python. Which is greate for learning, because you will learn about socket programming and cryptography.

If you are in a hurry, you can use a good SSH library.

If you are getting network connection error, please check whether SSH is installed in the remote machine or not. If yes, then check firewall settings.