Software Information |
Running a Program on a Remote Server Using SSH
How do you run a program on a remote server using ssh? For this example we'll have two servers, one named Johnny and another named Cash. Both are running openssh. Our goal is to have a program on Johnny login to Cash and run a program on Cash. To make the task a little more complex we'll be using different users on each machine. The first thing we'll need to do is generate public and private keys on Johnny. So, logged into Johnny as user 'boy' we create public and private keys by creating them in the .ssh directory as follows:
In the example above we picked an arbitrary name, sue, to identify the files that hold the generated keys. When prompted to enter a passphrase (twice) we simply hit enter twice. As the output of ssh-keygen indicates, the public key has been saved in a file named sue.pub. The output of ssh-keygen implies, but doesn't indicate directly, that the private key is in a file named sue (Yes, a user named boy created a file named sue.)
The private key file, sue, will remain on Johnny for the reaminder of this exercise, but the public key must be moved to the remote server, Cash. Note that the .ssh directory itself, as well as the sue and sue.pub files should have permissions of 700. Now you'll need to ftp the sue.pub file from Johnny to Cash. The user on Cash that we'll login as is user 'named'.
Now we'll telnet into Cash and concatenate the sue.pub file into /home/named/.ssh/authorized_keys file.
Let's recap what we've done so far. 1) We've created public and private keys on Johnny. 2) We've ftp'd the public key file, sue.pub, from Johnny to Cash. 3) We've telnetted to Cash, and concatenated the contents of sue.pub into authorized_keys We're now ready to manually login from Johnny to Cash using ssh.
Now on Johnny, create a shell script called 'boynamedsue.sh' with the following one line of contents and chmod the script to 777. ssh -i /home/boy/.ssh/sue named@Cash /usr/bin/ls -l Next, execute the script on Johnny.
You just executed a program on Johnny, that logged into Cash and ran a program (unix 'ls -l'). The next step you'll want to take is to replace the '/usr/bin/ls -l' command in the boynamedsue.sh program with the path and name of the program that you want to run. About The Author C.S. Deam is a small business owner. His eBook Computer Nuggets: Non-Techie Internet Tips For In-Laws, Out-Laws, and the Rest of Society is a great gift for non-techie family members and is available at www.LinkertonPublishing.com where you can sign up for FREE E-Courses & Newsletters to help you on your path to self-employment.
MORE RESOURCES: Unable to open RSS Feed $XMLfilename with error HTTP ERROR: 404, exiting |
RELATED ARTICLES
An Easy Way to Develop JAVA Enterprise Applications Research bears that less than 70 percent of development projects are actually completed, and more than half come in late and over budget. AlachiSoft TierDeveloper is a Rapid Application Development tool that helps Software Developers do better, more creative, and useful work by reducing redundant hand coding. Microsoft CRM Integration & Customization: SharePoint Document Gateway MS CRM is very close to document workflow automation, including Microsoft Office documents: Words, Excel, etc. The document workflow was perfectly automated about 10 years ago in Lotus Notes Domino. Microsoft Great Plains BR: Bank Reconciliation Microsoft Business Solutions Great Plains is marketed for mid-size companies as well as Navision (which has very good positions in Europe and emerging markets where it can be easily localized).Great Plains Bank Reconciliation (BR) module lets you manage all of your bank-related activity through a single automated intersection, including cash, check, and credit card transactions, bank account balances, and automated reconciliation. Microsoft Retail Management System (RMS) SQL Customization - Overview for Programmer Microsoft Retail Management System serves retail single store as well as retail chains clientele. The customization scenarios, described in this article deal with the chains, when Microsoft RMS has multiple stores databases and Headquarters. Dont Choose Adobe When Working With PDF While Adobe is the most known maker of PDF tools, your business will be much better off, if you select third party tools to work with PDF documents.ABC Amber PDF converterPriced at eleven dollars, this tool may very well be the cheapest PDF software on the planet. Microsoft Navision Database Selection: C/SIDE or MS SQL Server - Overview For IT Specialist There are certain pluses and minuses in both cases and you should make your decision, based on your company needs. We'll give you some hints in this subject and you should know then where to look further. Microsoft Great Plains Beverage Production & Distribution - Implementation & Customization Highlight Microsoft Business Solutions Great Plains has many years of successful implementation in multiple horizontal markets. In today's small article we'll share our experience of implementing and customizing Microsoft Great Plains, formerly Great Plains eEnterprise/Dynamics in beverage production and distribution industries. Microsoft Small Business Manager eCommerce - Overview Microsoft Business Solutions Small Business Manager is scaled down Great Plains Dexterity based version of Microsoft Great Plains or former Great Plains Dynamics/eEnterprise. Small Business Manager first release 7. Screenshots Vista Windows FeaturesAdditionally, Vista will include many other new features.AeroVista will include a completely re-designed user interface, code-named Aero. Unwanted Files A LOT OF UNWANTED FILES.When you uninstall an item of software, there are generally a number of redundant files left behind to clutter up your hard drive. Great Plains Custom Development: Dexterity, VBA, SQL, Crystal, eConnect - Overview For Programmer Microsoft Great Plains is main Microsoft Business Solutions accounting package for the US market. It has multiple customization/modification/reporting tools. Computer Based Language Development and Spell-checking Language development computer:Computer-based method for aiding language development seems like an interesting idea, the trick with this would be in getting the computer to take on part of the role of the human in the checking process.In all computer aided learning applications aimed at the very young, there is a danger that the computer may be seen as a replacement for a human instructor, however computer are notorious for not volunteering information or inability to deal with erratic behaviour. CROOK: A Methodology for the Refinement of Forward-Error Correction Table of Contents1) Introduction2) Related Work3) Framework4) Implementation5) Performance Results5.1) Hardware and Software Configuration5. IBM Lotus Domino or Microsoft Exchange? IBM Lotus Domino or Microsoft Exchange?The severe competition continues for many years between two main leaders in collaboration solutions - IBM and Microsoft. Whether the choice of a platform influences the ordinary user? The both of software giants put efforts to improve working conveniences for end Internet users. Microsoft Great Plains Customization Recovery & Upgrade for Large Corporation At the end of XX century, in the late 1990th Great Plains Software eEnterprise was recognized as one of the leader on the midsize to large corporate ERP market. Due to the nature of eEnterprise architecture - it is Great Plains Dexterity based application and Dexterity imposes some specific to the database access and table structure - eEnterprise was subject to relatively inexpensive customization. Microsoft Great Plains Implementation for Midsize & Large Corporation: Lockbox Processing Microsoft Great Plains is now targeting large and midsize businesses and being matured ERP has advanced, but still very simple in use modules and features: Lockbox Processing for Accounts Receivables, Customer/Vendor Consolidation, Multicurrency etc. We'll try to cover these features in the series of small articles to help decision maker and end user understand the feature and how does it work to make a decision to purchase additional nice modules. Software Piracy - Global Increase Pirated software is on the increase and now accounts for over one third of the software installed on the world's computers and it's cost the software industry a staggering, $28bn (£12bn) last year in lost revenues. That's the startling claim of the UK based, Business Software Alliance. Microsoft Business Solutions Customization Options - Overview for Programmer Several years ago Microsoft purchased Great Plains Software, then Navision (Denmark based software development company). At this time Great Plains Software already was active ERP applications consolidation player - it already acquired Solomon Software couple of years prior. Microsoft CRM Customization: Integration with Third Party SQL Application/Database Microsoft CRM - Client Relationship Management package from Microsoft Business Solutions was initially designed to be customizable with Microsoft Visual Studio.Net and one of its programming languages - C#. Editing Your Photos Using Microsoft Picture It Publishing Platinum 2002 - A Great Dinosaur I started using PIP (Picture It Publishing) Platinum 2002 right after I got it in a bundle with my HP Pavallion N5295 Notebook more than several moons ago!I don't want to be a rocket scientist to produce edited photos quickly and with quality results, again and again.I had a terrible time at first with the edited pictures. |
home | site map | contact us |