![]() | |
![]() | |
![]() |
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: Why These 15 Software Stocks Are Skyrocketing So Far in 2025 Insider Monkey What OpenAI’s Sales Automation Software Can Do—and What It Can’t The Information DMV rolls out new 605Drive software Dakota News Now Replit and Anthropic’s AI just helped Zillow build production software—without a single engineer VentureBeat Chip design software maker Cadence forecasts annual profit below estimate, shares down - Reuters.com DARPA Gets Word Out on Secure Software for Military National Defense Magazine FTC settlement requires disconnection of hardware from all no longer supported software Data Protection Report Iodine Software Launches Appeals Management Workspace Supporting Denials Management, Alongside GenAI Platform Enhancements Business Wire Telos Alliance Announces Axia Quasar V3.2 Software Update Sports Video Group The Impending Disruption That Will Transform IT and the Workforce: “Service-as-Software” Logistics Viewpoints Iodine Software Launches Appeals Management Workspace - HIT Consultant Commissioners approve new software for Lebanon Justice Court lebanonlocalnews.com Regula Software Now Supports the Latest Standard for Biometric Passport Verification - Business Wire Terma to supply C2 software for Slovakia’s Barak MX Airforce Technology CobbleStone Software Offers CobbleStone Contract Insight® CLM Solution Via Texas DIR Contract PR Web Raynault VFX, Stability AI Join the Academy Software Foundation Animation World Network FSF Opens Nominations For Free Software Awards iProgrammer 10 Hot Software Stocks with High Upside Potential Insider Monkey ECI Software Solutions Appoints Hildebrand CIO Quality Magazine Regula Software prend désormais en charge la dernière norme de vérification biométrique des passeports The Hastings Tribune Lucid Dream Software details benefits of new consumables platform Label & Narrow Web Researchers approach industry for commercial software dashboard to link legacy databases for decision-making Military & Aerospace Electronics Regula Software unterstützt jetzt den neuesten Standard zur biometrischen Reisepassprüfung The Hastings Tribune Regula Software unterstützt jetzt den neuesten Standard zur biometrischen Reisepassprüfung The Bakersfield Californian Blaize Holdings: Why I Am Betting On This AI Hardware And Software Small Cap (NASDAQ:BZAI) Seeking Alpha ezPaycheck Payroll Software Eliminates the Daunting Task of Tax Calculations for Business Owners Longview News-Journal Accenture: SDV requires transformational software mindset Automotive World France’s Cycloid gets €5M to promote efficient software delivery along with digital sobriety Silicon Canals Robot Software Market Hits New High | Major Giants Universal Robots, Yaskawa Motoman, Siemens openPR Electronic Signature Software Market Is Booming Across the Globe:: DocuSign, Adobe Sign, HelloSign openPR Creator Of New Open-Source Game Boy Disagrees That FPGA Is Superior To Software Emulation Time Extension AIDA64 now supports Radeon RX 9070 series, software drops support for Windows 95/98 - VideoCardz.com 2025.2.6 Official Tesla Release Notes - Software Updates Not a Tesla App Outside expands its outdoors media empire with acquisition of booking software developer The Colorado Sun PAC Programming Software Market Growth Outlook (2023-2032): Emerging Technologies Driving Innovation openPR |
![]() |
![]() |
![]() |
RELATED ARTICLES
Microsoft CRM Customization - Programming Closed Email Activity Microsoft CRM is CRM answer from Microsoft and attempt to get market share from Siebel, Oracle and others traditional Client Relationship Management System vendors. Microsoft CRM uses all the spectrum of Microsoft recent technologies: . Implementing ERP for Large Publicly Traded Corporation - Microsoft Great Plains We would like first emphasize the change in the paradigm. If you look back - 20 years or even 10 years - those days you saw ERP/MRP monster applications/systems winning time. A Time-Saving Programming Tactic that Doesn't Work Let's say that you have a software project that's under severe time pressure. Let's say that this deadline is so tight that you already know it will involve many late nights of black coffee and frenetic programming. Pros and Cons of Using FREE Software in Your Business It??s easy to understand why you might be drawn to the allure of free software. After all, it is free and free is always a good price to pay. RFID: Strengthen the Position for SAP; United States SAP Inc., a global leader in client/server enterprise application software that for years been the backbone to RFID application has seen a 1,000% spike year-over-year in customers, interested in RFID deployment. Four Desktop Tools To Drastically Increase Your Productivity Sticky Noteshttp://www.deprice. Google Brings the Earth to Your Desktop Google Inc. has launched a new software package that allows you to see satellite images on your desktop. Microsoft Great Plains Oil & Gas - Implementation & Customization Highlights Microsoft Great Plains serves the wide spectrum of horizontal markets. Great Plains could be considered as ERP platform, which you could expand with third party modules or advance with your own in-house custom functionality. Who Is Minding Your Sensitive Data? Stealing company information used to be the specialty of spies and conspirators. It was something that only happened to the most powerful of corporations and branches of government. Things You Can Do With Windows XP! Did you ever give a thought to the number of things you can do with Windows XP? Take your own time and think.. Can You Calculate Complex Financial Calculations? Are you a whiz at calculating financial information? Not the easy personal stuff, like figuring out your monthly mortgage based on a fixed interest rate for x number of years, or how much money you have available each month after all your bills are paid. (You can probably use your fingers to figure that one out!)But the hard stuff, you know, the things you need to know when you're running a small business. What Stands Behind The Software Description? With thousands of web pages added to the Net every day, it's getting more and more frustrating both to submit the information to the attention of those, who are interested in it and to find the information one needs.The problem is even aggravated with the fact that customers become more exigent to the products they are offered. Benefits of Shareware Shareware has been fighting the stigma of being misunderstood for decades. While corporate software giants can no longer ignore the marketing potential of a trial version, small software startups are struggling with new listings and bandwidth costs. Resume Software - Advantages Revealed The various resume software offered, particularly on the internet, can seem very attractive to job seekers; especially to those not comfortable writing resumes. At first glance resume writing software can provide a number of perks and can appear to be the perfect solution to many job seekers. Microsoft CRM Customization Secrets - Second Edition This article is for advanced Microsoft CRM SDK C# developers. It describes the technique of direct SQL programming, when SDK doesn't have the functionality to do the job. Introduction To ISDN, Part II In the previous ISDN article, we looked at how and why one router dials another using ISDN. Just as important is knowing what keeps the link up once it is dialed. 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. Create A Flash Presentation For Free With Open Office The intentions of this short tutorial are not to teach you how to use Open Office, but rather to show you a quick and dirty way to create presentations and tutorials that can be exported as a Macromedai Flash file.What is Open Office? It is a free, open source, cross platform office suite that has a lot of the same features as popular commercial suites. Internet Faxing Service Review The Internet is reshaping every form of communications medium, and faxing is no exception. The latest twist: Internet faxing services that let you send messages to any fax machine from any Web browser or email, and others that give you a "personal fax phone number," then forward any documents sent there to your e-mail inbox. MultiNational Corporation ERP Implementation - Microsoft Business Solutions Great Plains If you look back to the history, you will see that ERP for large publicly traded company had to be built upon very reliable hardware (more likely non-Intel hardware: mainframe, Sun sparc, etc.), powerful database platform: Oracle, DB2, Ingress, Sybase and reliable OS: UNIX. ![]() |
home | site map |
© 2006 |