Python SSH Client - Paramiko. SSH with Python.

  Рет қаралды 79,527

DevOps Journey

DevOps Journey

Күн бұрын

Пікірлер: 67
@TheModsRE4
@TheModsRE4 3 жыл бұрын
Very useful and easy to understand. I had to use the passphrase instead of password to make it works, but in general, everything was the same, THANKS A LOT!
@Zancb
@Zancb 3 жыл бұрын
Hi there. Thanks for the video. One quick suggestion: Do not connect to host machines as root. Connecting as root (or allowing root over ssh) is a gigantic security flaw. We (as in the IT community) should promote the use of connecting to a remote host as a specific user, rather than root. Thanks again! This is really cool stuff.
@chriskeo392
@chriskeo392 3 жыл бұрын
Request: ssh basics/fundamentals. And it's use cases Would be great.
@duanewalker8925
@duanewalker8925 3 жыл бұрын
Paramiko makes it really easy to connect to Linux servers and Cisco devices. I used to do this with Perl years ago but it was very frustrating. You had to tell the library the different prompts, etc. IOS and CatOS devices worked differently.
@seantellsit1431
@seantellsit1431 2 жыл бұрын
I'm not sure what I'm doing wrong.... when I try to run the snippet at 1:30, I keep getting an error. "PermissionError: [Errno 13] Permission denied: 'C:/Users/seans/.ssh/known_hosts' I've launched python from an elevated command prompt, but no joy.
@Networkprofessor
@Networkprofessor 5 ай бұрын
Thanks!
@mav29
@mav29 3 жыл бұрын
great job, perfect example very clear, concise easy to learn. well explained
@ozzman530
@ozzman530 Ай бұрын
Interesting that the presence of a ssh certificate in the Known_hosts file instantly breaks paramiko when you get to the load keys step. Was hoping to get a tip on connecting paramiko to an adva networking device but I encounter a Authentication failed error from python. If you have idea on how to debug paramiko authentication I'd love to get your thoughts.
@user-tf4rs7um5e
@user-tf4rs7um5e 3 ай бұрын
Very well done, great explanation! Thank you. Have you done much with the stdin? When is it useful within paramiko?
@sandhuaditya4855
@sandhuaditya4855 Жыл бұрын
How do you keep the The shell to persist with these commands. Like your pulling the hostname, if you go ahead and navigate to a particular directory. And then in the next command You want to touch file .txt you will notice that the exec closed out and that you are not in the directory that You Navigate to do but are in the home directory again. You have to change the commands inside a single exec Is there any way around that
@anatoly_north2564
@anatoly_north2564 3 жыл бұрын
thx! you video my problem with Piramiko
@robertofleitas2612
@robertofleitas2612 Жыл бұрын
Hello, how can I make an paramiko SSH connection to a SSH host, through remote desktop (RDP)? thank you.
@Sparshchokra
@Sparshchokra 2 жыл бұрын
Hi Sir, Can you please specify how may I use this inspect() function to get knowledge about object?
@vishalmaurya972
@vishalmaurya972 2 жыл бұрын
Great Content. Could you please help me for SFTP using paramiko only the current data-1 files from Lan to remote server. I guess exec_command will work on remote server only. What if we want to run the command on out Local i.e. LAN files? please help.
@preethiratnala3650
@preethiratnala3650 2 жыл бұрын
I did same as you said but when I replace hostname with directory command 'ls -lrt' Its giving total 0 why its happening
@chriskeo392
@chriskeo392 3 жыл бұрын
Sick content
@rishabhgupta7742
@rishabhgupta7742 2 жыл бұрын
Will this code work for connecting host with IPv6 address as well? If not what changes might be required.
@thefamousdjx
@thefamousdjx 2 жыл бұрын
Any idea how you would then connect to a mysql database in that server? I cant find anything about this
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
You would connect to it the same way as if you were SSH'd into another server. Should just be able to run your sqlclient command to connect
@francescoleo2167
@francescoleo2167 2 жыл бұрын
Hi, could you share the coding again ? Cus the link for Code Available is not available now🤕
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
Apologies, the website is back up now!
@juanariza9093
@juanariza9093 3 жыл бұрын
How do I save command output to variables? I am not able to manipulate variables when assigning variables to output
@andreygunz179
@andreygunz179 3 жыл бұрын
how do you run more then 1 command on 1 host for example a switch that needs password>cli>configure>hostname its been hell searching for a solution online
@samira-alirn
@samira-alirn Жыл бұрын
It was so helpfull for me thank u very much
@toshumalhotra
@toshumalhotra 2 жыл бұрын
But how you get authenticated, you haven't supply password for root anywhere, have you already copied your public key to all nodes?
@sophylong5940
@sophylong5940 2 жыл бұрын
can you help me with a code that actually download a file already uploaded in a remote server?
@vibhorkumar8854
@vibhorkumar8854 2 жыл бұрын
How to keep ssh alive for long running cmd on a remote server? I am getting socket timeout and buffed.timeout while running long running shell command on remote host.
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
Timeouts would be on the serverside. Check the settings on the remote host ssh server service.
@juanpe5144
@juanpe5144 3 жыл бұрын
Hello I have a duubt if I want send more command how I can do it?
@igorfagundes2177
@igorfagundes2177 3 жыл бұрын
3:53 As a robot, I got offended
@DevOpsJourney
@DevOpsJourney 3 жыл бұрын
🤣 🤖🤖🤖
@prasadsankar3775
@prasadsankar3775 3 жыл бұрын
Thanks for the video. I have a question - How to change directory after SSHing the server?
@MaîtrePhoque
@MaîtrePhoque 3 жыл бұрын
cd
@joostvoncken950
@joostvoncken950 2 жыл бұрын
isnt the autoaddPolicy vulnerable for Man in the middle attacks?
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
If you are in a more secure environment you could add to known hosts manually
@davipires2999
@davipires2999 2 жыл бұрын
Can I use the paramiko to run a script in the vm that the ssh server is installed?
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
Yup!
@davipires2999
@davipires2999 2 жыл бұрын
@@DevOpsJourney the machine that the ssh server installed can be windows? Everything Will work fine on windows?
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
@@davipires2999 yes you can use paramiko to ssh into a windows box
@davipires2999
@davipires2999 2 жыл бұрын
@@DevOpsJourney thanks mate, i'll try this tomorrow in my internship!!!
@thulasisunny1951
@thulasisunny1951 2 жыл бұрын
Hi, When I run the command same you given i am getting this error "Could not chdir to home directory /home/kyndrylssh: Permission denied" , can you think is that SSH connected ??? how can we confirm that...
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
Try a 'hostname'. That's how I confirm
@thulasisunny1951
@thulasisunny1951 2 жыл бұрын
@@DevOpsJourney u mean command 'hostname'? I am getting something for that also
@shristiagrawal2080
@shristiagrawal2080 3 жыл бұрын
How to open shell using this and see what's going on
@simoneonorato1223
@simoneonorato1223 3 жыл бұрын
Sorry but how do you tell your program where the private key is stored on ur pc?
@DevOpsJourney
@DevOpsJourney 3 жыл бұрын
Hey Simone. Use the below function and specify the path: load_system_host_keys(filename='path/to/hostkeys') I hope that helps!
@simoneonorato1223
@simoneonorato1223 3 жыл бұрын
@@DevOpsJourney Thanks a lot!!!!
@TheSaruVerse
@TheSaruVerse Жыл бұрын
but does paramiko support ssh multiplexing ? if number of sessions are running , just like ssh natively supports , please help
@DevOpsJourney
@DevOpsJourney Жыл бұрын
hey there, as of my knowledge, it does not support SSH multiplexing... but I could be wrong
@TheSaruVerse
@TheSaruVerse Жыл бұрын
@@DevOpsJourney thanks for the reply , but do you know anything which could ease up or does have the same kind of functionality, i am working on a project which involves multiple ssh to get some of the system metrics from the os , but i cant use any of monitoring tools , i can only use ssh any help i would really appreciate thanks
@kennychavez8994
@kennychavez8994 3 жыл бұрын
I have a problem. It seems that the fingerprint of the server I was connecting to changed, but I can't get it to work again. It gives me this error: Traceback (most recent call last): File "C:\Users\user\Documents\update_automation\main3.py", line 12, in stdin, stdout, stderr = client.exec_command('hostname') File "C:\Users\user\Documents\update_automation\venv\lib\site-packages\paramiko\client.py", line 514, in exec_command chan.exec_command(command) File "C:\Users\user\Documents\update_automation\venv\lib\site-packages\paramiko\channel.py", line 72, in _check return func(self, *args, **kwds) File "C:\Users\user\Documents\update_automation\venv\lib\site-packages\paramiko\channel.py", line 257, in exec_command self._wait_for_event() File "C:\Users\user\Documents\update_automation\venv\lib\site-packages\paramiko\channel.py", line 1226, in _wait_for_event raise e File "C:\Users\user\Documents\update_automation\venv\lib\site-packages\paramiko\transport.py", line 2055, in run ptype, m = self.packetizer.read_message() File "C:\Users\user\Documents\update_automation\venv\lib\site-packages\paramiko\packet.py", line 459, in read_message header = self.read_all(self.__block_size_in, check_rekey=True) File "C:\Users\user\Documents\update_automation\venv\lib\site-packages\paramiko\packet.py", line 303, in read_all raise EOFError() EOFError
@TheSibyjohn
@TheSibyjohn 3 жыл бұрын
please how long and big is this code?
@varadmulay
@varadmulay 2 жыл бұрын
what is in the "known_hosts" file ?
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
Server fingerprints. That prompt that comes up when you ssh into a new server asking about if you trust the finger print - when you do it's saved to the known hosts file. If you try to connect to a server with the same IP but the fingerprint has changed, ssh will warn you that something has changed
@varadmulay
@varadmulay 2 жыл бұрын
@@DevOpsJourney in what format ? Ip, type, pkey?
@enriquecordero6163
@enriquecordero6163 3 жыл бұрын
Is possible to do a sudo to another user? , ssh with brad and then sudo to tomcat?
@DevOpsJourney
@DevOpsJourney 3 жыл бұрын
maybe try 'su tomcat'
@enriquecordero6163
@enriquecordero6163 3 жыл бұрын
@@DevOpsJourney and the password?
@francis.joseph
@francis.joseph 2 жыл бұрын
How to get the known hosts file created
@DevOpsJourney
@DevOpsJourney 2 жыл бұрын
should be in ~/.ssh/known_hosts, or c:\users\\.ssh\known_hosts
@rsskg
@rsskg 2 жыл бұрын
How to stay on server in comand-line?
@stfu_anderr
@stfu_anderr 2 жыл бұрын
use while and instead of 'hostname' enter 'input()'
@DavidCSaint
@DavidCSaint 3 жыл бұрын
This is great
@shayelasharma1039
@shayelasharma1039 Жыл бұрын
thanks man
@Networkprofessor
@Networkprofessor 5 ай бұрын
Sent thanks
Python Diagrams - Make incredible Diagrams using Python
5:42
DevOps Journey
Рет қаралды 62 М.
Python Tutorial: Calling External Commands Using the Subprocess Module
19:01
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Automation Using Python | SSH to Cisco Device
21:37
My IT Workshop
Рет қаралды 36 М.
How to design a modern CI/CD Pipeline
9:59
DevOps Journey
Рет қаралды 187 М.
Simple Automated SSH Python Bot
17:50
NeuralNine
Рет қаралды 33 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
Manage SSH connections with Python for Secure Remote Login
9:32
Practical Python Solutions
Рет қаралды 39 М.
Transfer a file from local server to remote server and vice versa using paramiko of python
10:18
Python dataclasses will save you HOURS, also featuring attrs
8:50
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН