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: Artificial intelligence software at Zuckerberg S.F. General Hospital helps flag stroke risk San Francisco Chronicle DOD taps ‘integrated software enablers’ to help fully realize ambitious Replicator plans DefenseScoop London startup Agemo has exited stealth. Now, it's building AI reasoning for software to take on Poolside and Magic. Business Insider Keysight Providing Software to Enable Researchers through the Microelectronics Commons Business Wire Business Insider's Rating Methodology for Tax Software Business Insider RatedPower expands efficiency and precision with solar project design software release - PR Newswire AV Unveils Advanced Software Updates to Enhance Puma UAS Capabilities in Contested Environments Business Wire The Generative Software Cycle is Here: OutSystems Introduces the Power of Low-Code x AI Business Wire Schrödinger Announces Multi-Target Collaboration and Expanded Software Licensing Agreement with Novartis Business Wire Anduril Lattice Software Enhances US CENTCOM Air Defense Exercise The Defense Post TestSprite nabs $1.5M to build autonomous AI software testing platform SiliconANGLE News LEAP, globally popular software for energy, climate mitigation, and air pollution planning, to be offered free to an additional 54 countries Stockholm Environment Institute Salesforce Loses Top Artificial Intelligence Executive, Says Analyst Investor's Business Daily AI-based ARIA detection software could bring 'renewed hope' for people undergoing Alzheimer's treatment Health Imaging DMDE review: How good is this free data recovery software? Digital Trends Precisely Named a Leader in IDC MarketScape: Worldwide Data Intelligence Platform Software, 2024 Yahoo Finance EasyODM Launches AI-Powered Machine Vision Software Vision Systems Design Epic software helps veterans access VA benefits Verona Press Joget Earns GovStack Software Requirements Compliance ENGINEERING.com Enterprise Software in the Age of Generative AI GP Bullhound Fast 50 2024: Fearless aims beyond software after first acquisition The Business Journals Exclusive | FBI used ‘software tools’ to search social media for election-related talk: analyst New York Post Best Human Resources Software - 2024 Reviews & Pricing Software Advice Amundi buys wealth software firm Aixigo Financial News KIC Launches Game-Changing TAS Software Platform to Address Emerging Thermal Process Challenges AZoRobotics Take-Two Interactive Software Chief Financial Officer Lainie Goldstein Sells 35% Of Holding Simply Wall St Aviation Software Market Revenue to Attain USD 21.55 Bn by 2033 Precedence Research Samsung Galaxy S25 to offer 7 years of One UI software updates: Will you use it for that long? Sammy Fans Indian payments platform Razorpay launches B2B software fund - Global Corporate Venturing Danfoss Power Solutions launches ACL 3.2 software Industrial Vehicle Technology International PTV updates truck route-planning software Traffic Technology Today Open-Source Software Is in Crisis IEEE Spectrum MSU, Web Software Engineer II, Bozeman Daily Chronicle From self-driving cars to AI that writes enterprise software: Cogna founder raises $15M - TechCrunch Nucleus Software Exports Limited Just Missed EPS By 23%: Here's What Analysts Think Will Happen Next Simply Wall St Montclair Council Passes Cell-Tower Ordinance, Tables Storm Water Regulation and Software Agreement TAPinto.net The Intellectual Property Software Market Reach USD 31.3 Billion by 2032 Growing with 15.6% CAGR EIN News Snyk founder’s Tessl raises $125M to revolutionise AI native software creation with spec-centric model Tech Funding News Danfoss software enables autonomous control Power Progress |
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 |