![](/uploads/1/2/6/6/126677732/342001894.jpg)
Using ExtraPuTTY.Chapter 3: Using ExtraPuTTYThis chapter provides a general introduction to some more advanced features of ExtraPuTTY. For extreme detail and reference purposes, is likely to contain more information.3.1 During your sessionA lot of ExtraPuTTY's complexity and features are in the configuration panel. Once you have worked your way through that and started a session, things should be reasonably simple after that.
Launch plink from Command PromptYou can’t just double-click on plink.exe to launch it. Since this is a command-line only utility (Without GUI), you should first launch your Windows command prompt.For 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.Also, depending on where you have downloaded the plink.exe, you may have to modify the Windows’s PATH variable accordingly.Go to your “System properties” windows, click on “Environment Variables”, select Path variable, and append the directory where the plink.exe is located here.Or, you can just set your PATH variable as shown below. In the following example, I’ve downloaded the plink.exe to C:Downloads directory.
Configure the.vnc/xstartup script. Using the TTL serial port. You can try TeraTerm or Putty to use the TTL serial port. (With thanks to native speaker “roses” for checking and upgrading this document) For example,in the Putty Software,the configuration interface like as below. Chapter 7: Using the command-line connection tool Plink. Plink (PuTTY Link). Or a whole shell script. 7.2.3.8 -L and -R set up port forwarding. Plink allows you to use port forwarding just as PuTTY does; if you have set up a PuTTY saved session that specifies port forwardings, and you connect to that session using Plink, then the same port.
Set PATH=%PATH%;C:DownloadsNext, type plink in the command prompt, this will display the various options available. Plink Interactive SSH SessionThe following is the basic syntax for plink: plink options connection commandIn the above syntax:. options – You can pass various options to plink. This is optional.
connection – This will have the connection information of the Linux server that you want to connect to. Various connection methods are explained in the examples below. command – This is the command that should be executed on the remote Linux server.
This is optional.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. As explained earlier, plink is not meant to be used as interactive session.
![Putty command line options Putty command line options](http://3.bp.blogspot.com/-s-ZFt09uTDo/UTRExls_upI/AAAAAAAAAyw/YmYzX7MT6DE/s1600/Cara-Menghubungkan-Cisco-ke-PC-Laptop-2.png)
Use putty for interactive session.For now, let us see various methods to use the connection.First, you can just give the ip-address of the remote-server. This will then ask for the username and password to login. C:plink 192.168.101.1login as: [email protected]'s password:Or, you can also use the username using @ symbol as shown below. This will ask only for the password, as we’ve specified the username. C:plink [email protected] username 'root'[email protected]'s password:You can also pass the username using -l option as shown below: C:plink 192.168.101.1 -l mysqlYou can also use the name of an existing putty session. In this example, I’m using the existing saved putty session called “devdb”. This is the recommended way of using, as you can bring all the configuration information from PuTTY to here for this particular “devdb” session.
C:plink devdbUsing username 'root'[email protected]'s password:The following -load is exactly the same as above. C:plink -load devdbUsing username 'root'[email protected]'s password:As you see below, once you login, you’ll get a command-prompt. But, doing anything here will display some non user-friendly characters. C:plink devdbUsing username 'root'[email protected]'s password:?0;root@devdb:root@devdb #?0;root@devdb:root@devdb #?0;root@devdb:root@devdb #?Kls -altrtotal 326432drwx-. 2 root root 4096 Jan 23 2016?01;34m.ssh?0mdrwxr-xr-x. 2 root root 4096 May 9 2016?01;3Documents?0mdrwxr-xr-x.
2 root root 4096 May 8 12:41?01;3Downloads?0m?m?0;root@devdb:root@devdb #Again, for interactive SSH session, please use PuTTY.On a related note, even if you’ve been using PuTTY for a while, you might find few tips from here helpful: 3. Plink Non-Interactive SSH Session to execute a Remote CommandUsing plink, from windows, you can execute a command on the Linux server without any user interaction and just display the output.For this, pass the command as the last argument to the plink as shown below.In the following example, it will execute “crontab -l” command on the remote server and display the output. C:plink [email protected] crontab -lno crontab for rootIf you want to execute multiple commands, then group them together as shown below. C:plink [email protected] (hostname;crontab -l)devdb.thegeekstuff.comno crontab for rootThe following will execute the db-backup.sh shellscript on the remote Linux server. But, you are initiating this from your Windows machine. Plink [email protected] /root/bin/db-backup.shFew points to keep in mind:. If the above command is asking for password, and if you don’t want that to happen, you should setup the public-private key authentication appropriately so that remote Linux server doesn’t ask for password.
You can also pass the password as a command-line option to plink as shown in one of the examples below. Also, if the above displays an error message about invalid protocol, then you should pass the appropriate protocol as shown in the next example.4. Execute Multiple Linux Commands from a Windows FileInstead of specifying all the commands to be executed on the remote Linux server in the plink command-line, you can also put them in a text file and specify the file as a parameter to the plink.For example, create the following file called commands.txt on your Windows. C:type commands.txthostnameservice mysql stopyum -y install httpdservice mysql startservice httpd startcrontab -lNow to execute all of the above commands on the remote Linux server one-by-one in a sequence, execute the following plink command on your Windows laptop. C:plink [email protected] -m C:commands.txt5. Specify Connection ProtocolPlink allows the following protocols: SSH, Telnet, Remote Login (rlogin), Raw, Serial ConnectionThe most popular and the default is SSH. Use -ssh as shown below.
![](/uploads/1/2/6/6/126677732/342001894.jpg)