![]() In the following example, it will execute “crontab -l” command on the remote server and display the output. Using plink, from windows, you can execute a command on the Linux server without any user interaction and just display the output.įor this, pass the command as the last argument to the plink as shown below. Plink Non-Interactive SSH Session to execute a Remote Command On a related note, even if you’ve been using PuTTY for a while, you might find few tips from here helpful: 10 Awesome PuTTY Tips and Tricks You Probably Didn’t Know 3. 2 root root 4096 May 8 12:41 ~]#Īgain, for interactive SSH session, please use PuTTY. But, doing anything here will display some non user-friendly characters. ![]() C:\>plink -load devdbĪs you see below, once you login, you’ll get a command-prompt. The following -load is exactly the same as above. This is the recommended way of using, as you can bring all the configuration information from PuTTY to here for this particular “devdb” session. In this example, I’m using the existing saved putty session called “devdb”. You can also use the name of an existing putty session. You can also pass the username using -l option as shown below: C:\>plink 192.168.101.1 -l mysql This will ask only for the password, as we’ve specified the username. Or, you can also use the username using symbol as shown below. This will then ask for the username and password to login. Use putty for interactive session.įor now, let us see various methods to use the connection.įirst, you can just give the ip-address of the remote-server. As explained earlier, plink is not meant to be used as interactive session. While the command is optional, when you don’t give it, it will display a raw interactive session, which will have lot of non-printable non-readable character on the screen. ![]() command – This is the command that should be executed on the remote Linux server.Various connection methods are explained in the examples below. connection – This will have the connection information of the Linux server that you want to connect to.options – You can pass various options to plink.The following is the basic syntax for plink: plink connection Next, type plink in the command prompt, this will display the various options available. In the following example, I’ve downloaded the plink.exe to C:\Downloads directory. Or, you can just set your PATH variable as shown below. Go to your “System properties” windows, click on “Environment Variables”, select Path variable, and append the directory where the plink.exe is located here. Since this is a command-line only utility (Without GUI), you should first launch your Windows command prompt.įor this, click on start menu on your windows, and type “cmd.exe” in the search box and press enter, this will launch the Windows command prompt.Īlso, depending on where you have downloaded the plink.exe, you may have to modify the Windows’s PATH variable accordingly. ![]() You can’t just double-click on plink.exe to launch it. If you have a 32-bit Windows laptop, make sure you download the 32-bit version of plink. If you don’t have PuTTY already installed on your machine, make sure you also download putty executable along with plink. Plink -batch option for Windows Batch Filesįirst, download plink executable from here.Additional Enable and Disable Options for Plink SSH.Use Private Key File for Authentication with Plink.Execute Multiple Linux Commands from a Windows File.Plink Non-Interactive SSH Session to execute a Remote Command. ![]() In this tutorial, we’ll discuss the following:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |