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: Enterprise Software Veterans Launch Izzi Software, Announce ColeSoft as First Mainframe Industry Acquisition Business Wire Check Point Software Reports Fourth Quarter and 2024 Full Year Results Check Point Software DeepSeek AI Is 'Good News' For Enterprise Software, Says SAP CEO Investor's Business Daily Advisory details ransomware attacks on SimpleHelp remote access software American Hospital Association Honda issues recall over software glitch. Which vehicles are affected Lansing State Journal Guide to Legal Technology Software Bloomberg Law Exclusive: Apex Custom Software hacked, threat actors threaten to leak the software DataBreaches.net Honda recalls 295K vehicles for software issue KOBI-TV NBC5 / KOTI-TV NBC2 Clear-Com Unveils EHX v14 Software Update Sports Video Group Walmart has H&R Block tax software on sale for up to $16 off to save on filing your 2024 taxes NJ.com JONAS CLUB SOFTWARE UNVEILS INNOVATIONS & THE JONAS OPEN VIRTUAL GOLF TOURNAMENT AT THE 2025 CMAA CONFERENCE The Golf Wire Nearly 300,000 Honda and Acura Vehicles Recalled Over Faulty Software, Engine Stall Risks AboutLawsuits.com Managing the Risks of China’s Access to U.S. Data and Control of Software and Connected Technology Carnegie Endowment for International Peace Serco Expanding U.S. Business With Acquisition Of Northrop Grumman’s Training And Software Unit Defense Daily Network Honda recalls 295,000 vehicles due to software error that could cause engine to lose power USA TODAY Atlassian Earnings Beat. Software Maker's Revenue Guidance Above Views. Investor's Business Daily North Korean Lazarus hackers launch large-scale cyberattack by cloning open source software TechRadar Checkpoint Software (CHKP) PT Raised to $220 at Stifel StreetInsider.com QBS Software picks up Prianto ComputerWeekly.com SLK Software's promoters look to sell majority stake The Economic Times Checkpoint Software (CHKP) PT Raised to $220 at Mizuho StreetInsider.com PE Weekly: Deloitte Acquires ERP Software; Food and Beverage Deals Return Middle Market Growth Website Builder Software Market is projected to grow at USD 3.9 billion by 2032, CAGR with 7.9% EIN News KCS showcases its latest software at ARA Show International Rental News Cathie Wood Says Software Is the Next Big AI Opportunity -- 2 Ark ETFs You'll Want to Buy if She's Right The Motley Fool IBM Stock Pops On Earnings Beat, Software Growth, Free Cash Flow Outlook - Investor's Business Daily IBM Stock Pops On Earnings Beat, Software Growth, Free Cash Flow Outlook Investor's Business Daily SAP extends support deadline for getting off legacy software – in very special circumstances The Register Checkpoint Software (CHKP) PT Raised to $240 at Raymond James StreetInsider.com Checkpoint Software (CHKP) PT Raised to $220 at Cantor Fitzgerald StreetInsider.com IRS details ‘Free File’ guided tax software Community journal IBM Is Seeing Growth in Software and AI Morningstar Appraisals for software engineers: Microsoft and Amazon are using performance reviews to decide who gets s The Economic Times Orchard Software Named Top LIS Vendor by 2025 Black Book Market Research for Seventh Consecutive Year PR Newswire Securing the Software Supply Chain: A 2035 Blueprint The New Stack American Honda Recalls 295,000 Vehicles in the U.S. to Update Fuel Injection Software Honda Newsroom Hg looks to raise $12bn for large-cap software bets Private Equity International Earthquake Alert Software Market May See a Big Move | Major Giants LastQuake,QuakeWatch,GEOFON openPR The toll Trump 2.0 could take on LatAm’s software, IT services exports BNamericas English Check Point Software Technology (CHKP) Tops Q4 EPS by 5c StreetInsider.com Check Point Software shares edge lower after Q4 results Investing.com Drone company's software will no longer stop flights over wildfires, other no-fly zones NBC San Diego Google open-sources the Pebble smartwatch’s software, and its creator is making a new model Engadget Startups to Watch 2025: VedaPointe's software automates workflow to improve health care The Business Journals NSA Jointly Releases Recommendations for Closing the Software Understanding Gap National Security Agency HeartBeam submits 510(k) application to FDA for ECG software Medical Device Network Former Cruise engineers launch AI-powered design software startup Hestus The Business Journals Plus expands from self-driving to software-defined ADAS Automotive World How a Free Software Strategy Catapulted DeepSeek to AI Stardom The Wall Street Journal |
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 |