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: 3 High-Growth Software Stocks to Gift for Christmas Yahoo Finance This Software Stock With 88% Expected Profit Growth Offers Entry Investor's Business Daily CPPIB bets on U.K.-based Octopus Energy, Kraken software to drive customers’ embrace of renewable energy The Globe and Mail Enterprise Software Stocks Atlassian, Asana, and Docusign Are All Suddenly Soaring. Which Is the Best Buy for 2025? The Motley Fool Delivering efficiencies through automated software testing Federal News Network Valsoft Corporation Secures $150M to Further Accelerate Growth in Vertical Market Software Sector AccessWire Tupelo Code Enforcement gets software upgrades Northeast Mississippi Daily Journal SAGT IPO News - Malaysian point of sale software provider Sagtec Global files for a $9 million US IPO Renaissance Capital NAVAIR Issues RFI for PMA-281 Hardware & Software ExecutiveBiz Why Trump DOGE Initiative Is A Wild Card For Palantir Stock, Software Makers Investor's Business Daily Software security in 2025 - Four encouraging trends App Developer Magazine The code whisperer: How Anthropic’s Claude is changing the game for software developers VentureBeat Moho Animation Software Releases Moho 14.3 Mantis Shrimp Animation World Network Why this self-made software engineer left Silicon Valley to focus on investing in women Technical.ly PlayStation's 2024 in review: Software and hardware underwhelm, but Sony’s never been stronger TechRadar Cybersecurity Stocks To Watch Heading Into 2025 Investor's Business Daily Exploring AI in Software Development Trends AppleMagazine 11 Best Enterprise Software Stocks to Invest In Insider Monkey 2024.45.32 Official Tesla Release Notes - Software Updates Not a Tesla App Palantir and Elastic: Daniel Ives Picks the Top AI Software Stocks to Buy as ‘Revolution Hits the Next Gear’ Yahoo Finance Software Is the Next Big AI Opportunity: 1 AI Stock Highly Recommended by Wall Street to Buy Now Yahoo Finance Turkish defense contractor wins top software exporter award for NATO intelligence project TurkishMinute An Exchange of Avanquest Software Shares Held by Eric Gareau for Claranova Shares, With No Dilutive Effect for Shareholders Business Wire Oracle Financial Services Software Limited (NSE:OFSS) On An Uptrend: Could Fundamentals Be Driving The Stock? Simply Wall St Palantir Stock: Why Software Stock Rally Will Extend Into 2025 Investor's Business Daily Symplr plans major technology rollout but cools M&A talk for now The Business Journals A Look Back at Automation Software Stocks’ Q3 Earnings: UiPath (NYSE:PATH) Vs The Rest Of The Pack Yahoo Finance EyeVision Develops Inspection Tool for Fastener Threads Vision Systems Design Sewing the digital thread for more sustainable AM VoxelMatters Software Is the Next Big AI Opportunity: 1 Brilliant AI Stock to Buy Ahead of 2025, According to Wall Street The Motley Fool Austin Software Dev Earned Her First Million with Chainlink & Solana – Now Eyes BlockDAG for More Gains Analytics Insight City: New meeting agenda software eases visually disabled's access to records - Santa Fe New Mexican City: New meeting agenda software eases visually disabled's access to records Santa Fe New Mexican Is Paycom Software, Inc.'s (NYSE:PAYC) Latest Stock Performance A Reflection Of Its Financial Health? Simply Wall St The Age of Quantum Software Has Already Started The Wall Street Journal Valsoft Corporation Secures $150M to Further Accelerate Growth in Vertical Market Software Sector Galveston County Daily News Q3 Earnings Highs And Lows: Salesforce (NYSE:CRM) Vs The Rest Of The Sales Software Stocks Yahoo Finance Microsoft Stock Gets a Fresh Price Target Amid Software Review Wall Street Pit Saratoga Springs Police Department implementing new Axon Fusus software The Daily Gazette |
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 |