[英]How to create directory in remote system using python script
I want to create a directory in my remote system using python script or by socket programming.我想使用 python 脚本或通过套接字编程在我的远程系统中创建一个目录。 I have remote system's Username, password and IP address.
我有远程系统的用户名、密码和 IP 地址。 I am able to do this in my local machine but not in remote.
我可以在本地机器上执行此操作,但不能在远程机器上执行此操作。 Please help!
请帮忙!
下载Putty然后连接到远程系统)并在终端中写入mkdir foldername
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.要在远程机器上创建目录,您必须先连接到它。Telnet 和 SSH 和 SSH 用于连接到远程机器。 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.
显然远程机器上应该运行TELNET或SSH服务,否则将无法连接。由于在Telnet的情况下,数据是以明文传输的,最好使用SSH协议。
Once connected to the remote machine using SSH, you will be able to execute commands on the remote machine.使用 SSH 连接到远程计算机后,您将能够在远程计算机上执行命令。
Now since you want to do everything in Python, you will have to write a complete SSH client in Python.现在,既然你想用 Python 做所有事情,你就必须用 Python 编写一个完整的 SSH 客户端。 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.如果你赶时间,你可以使用一个好的 SSH 库。
If you are getting network connection error, please check whether SSH is installed in the remote machine or not.如果您遇到网络连接错误,请检查远程计算机中是否安装了 SSH。 If yes, then check firewall settings.
如果是,请检查防火墙设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.