Thanks for this short but high signal video. After wandering the internet, looking at all kinds of this or that to simply open a tunnel, I landed here. Super super helpful and I very much appreciate you putting this together.
Can I able to run multiple commands with this code? I have a python file inside a jetson nano in desktop, so I need to make an application with tkinter to open that file from another system which has windows os through ssh.. Is it possible?
thanks so much, but I tried same thing with a command that runs a python script on my remote server, but the script is not running? is there anything else needed to run a python script on my remote server
@@practicalpythonsolutions-b4478 thanks for the reply. I tried a command that excutes python script in exec_command. exactly this client.exec_command("python3 script.py"), but it is not being excuted. also tried to create a bash script that excutes the python script and tried client.exec_command("./script.sh"), still not working. I've logged in to my remote server with putty and tried to run both the python script and bash script from there, both works fine
@@practicalpythonsolutions-b4478 okay I found out the script is actually being excuted. I printed out the stderr, and it prints error message "no module named numpy", but I definitely have numpy, I don't know why this error is ocurring
@@fenylmecc6347 can you run locally on the remote local machine? That's a pretty specific error and it's obviously not happy with the state of the numpy module
@@practicalpythonsolutions-b4478 the problem was when going through ssh it somehow won't find the proper environment. when I run the script specifying the path to the python environment on the remote server, it worked. just putting it here incase some one faced same problem. thanks for the video
Hey, Everything is so well explained, thank you so much!!!; but i have got an error saying: "failed to add the host to the list of known hosts windows", how do i resolve this? Thanks in advance!!!!
@@practicalpythonsolutions-b4478 Actually i don't want to become root, i have to switch to fssoadmin user and do file editing using sftp. Please help me out Below is my sample code: Client.connect(host,creds) Channel=client.invoke_shell() Now i'm switching to admin How to sftp now...? ftp=client.open_sftp() These files are being updated in first login, not switched user
@@practicalpythonsolutions-b4478 thanks Many thanks At 2:38 , I installed paramiko, but my terminal does not recognize the ssh comand. What you mean by "on windows you can enable it in the services"? Is that sintax ok for a Windows terminal as well? I'm using Visual Studio Code. If I don't have the IP of the server, but a URL, does it work anyway?
@@automaticasa_matteosulis if you are connecting to a windows box you will need to enable ssh on it. google "how to enable ssh on windows" and follwo along. Make sure that the dns name is working as well by pinging the name to see if you get a response. this will also give you the IP of the server, I suggest that you try to manually connect with ssh before running the script. for example. type "ssh IP of server" first to make sure that it's working correctly. Once that is done, then work with the python script
Thanks for this short but high signal video. After wandering the internet, looking at all kinds of this or that to simply open a tunnel, I landed here. Super super helpful and I very much appreciate you putting this together.
Hi. I am Sorry for the late reply. Thank you for your great feedback!
really clean code. Love the additional info on generating SSH keys for W01 and Linux! That's really helpful
Thank you for this, I will use this as a base for what I was trying to do with my Proxmox hypervisor.
Was exploring a paramiko authentication issue, do you happen to know how to debug authentication with Paramiko?
Great examples Paul nice to hear you still working on the channel.
Thanks John and good to hear from you. Hope all is well
Great stuff as usual! It's always fun to learn more from these videos.
Glad you enjoyed it!
Can I able to run multiple commands with this code? I have a python file inside a jetson nano in desktop, so I need to make an application with tkinter to open that file from another system which has windows os through ssh.. Is it possible?
you should be able to execute multiple commands . you would need to save the ouput of each command separately
thanks so much, but I tried same thing with a command that runs a python script on my remote server, but the script is not running? is there anything else needed to run a python script on my remote server
What’s the command?
@@practicalpythonsolutions-b4478 thanks for the reply. I tried a command that excutes python script in exec_command. exactly this client.exec_command("python3 script.py"), but it is not being excuted. also tried to create a bash script that excutes the python script and tried client.exec_command("./script.sh"), still not working. I've logged in to my remote server with putty and tried to run both the python script and bash script from there, both works fine
@@practicalpythonsolutions-b4478 okay I found out the script is actually being excuted. I printed out the stderr, and it prints error message "no module named numpy", but I definitely have numpy, I don't know why this error is ocurring
@@fenylmecc6347 can you run locally on the remote local machine?
That's a pretty specific error and it's obviously not happy with the state of the numpy module
@@practicalpythonsolutions-b4478 the problem was when going through ssh it somehow won't find the proper environment. when I run the script specifying the path to the python environment on the remote server, it worked. just putting it here incase some one faced same problem. thanks for the video
Amazing video! Thank you for sharing your knowledge
Glad it was helpful!
Hey, Everything is so well explained, thank you so much!!!; but i have got an error saying: "failed to add the host to the list of known hosts windows", how do i resolve this?
Thanks in advance!!!!
Thanks. Look in your .ssh dir for the known hosts file
‘cd ~/.ssh’
Once login, I'm switching to admin user using sudo su - user then it is asking for password. How to give that password from python paramiko?
can you try "sudo -i" instead? shouldn't ask you for a password
@@practicalpythonsolutions-b4478 Actually i don't want to become root, i have to switch to fssoadmin user and do file editing using sftp. Please help me out
Below is my sample code:
Client.connect(host,creds)
Channel=client.invoke_shell()
Now i'm switching to admin
How to sftp now...?
ftp=client.open_sftp()
These files are being updated in first login, not switched user
How would you do this for multiple clients?
Multiple clients for the one server? You may need ssh listening on multiple ports. I have not tried this tho
How to save the result and send it to mail
Hi. Sorry for the late reply. I will create a short to answer your question.
interpreter '/usr/bin/python' doesn't exist on remote server help me @@
Hi - Python is not required on the remote server. What is the code you are trying to execute?
@@practicalpythonsolutions-b4478 i want to connect to remove server but it is show this problem found
@@practicalpythonsolutions-b4478 i not want to excuse code
Thank you.
You are very welcome!
At 3.03 I'm lost. This is too fast for a tutorial.
Where r you lost so I can clarify
@@practicalpythonsolutions-b4478 thanks
Many thanks
At 2:38 , I installed paramiko, but my terminal does not recognize the ssh comand. What you mean by "on windows you can enable it in the services"?
Is that sintax ok for a Windows terminal as well? I'm using Visual Studio Code.
If I don't have the IP of the server, but a URL, does it work anyway?
@@practicalpythonsolutions-b4478 I also did not understand what file is needed on the client, where to put it, which format to use.
@@practicalpythonsolutions-b4478 I have an OpneSSH directori but I can't find any .ssh directory after the installation
@@automaticasa_matteosulis if you are connecting to a windows box you will need to enable ssh on it. google "how to enable ssh on windows" and follwo along. Make sure that the dns name is working as well by pinging the name to see if you get a response. this will also give you the IP of the server, I suggest that you try to manually connect with ssh before running the script. for example. type "ssh IP of server" first to make sure that it's working correctly. Once that is done, then work with the python script