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: Generative AI Software Sales Could Soar 6,260%: My Pick for the Best AI Stock to Buy Now (Hint: Not Nvidia) Yahoo Finance The hyper-clouds are open source's friends The Register Swiss Re completes milestone in safety performance assessment of Luminar's LiDAR & software driving system Reinsurance News Talent Management Software Market To Reach USD 23.9 Billion By 2032, Report By DataHorizzon Research Yahoo Finance Altus Group's Software, Services and Solutions Altus Group Ticked off! @bad device software - Ticked off! @bad device software Orlando Sentinel Exclusive | IBM Nears Deal for Cloud-Software Provider The Wall Street Journal Severe Flaws Disclosed in Brocade SANnav SAN Management Software The Hacker News Margaret Hamilton Software Engineer Top Sellers Atlanta Progressive News S.F. Muni software problem causes major downtown transit issues San Francisco Chronicle AMD Radeon Software Adrenalin 24.4.1 VideoCardz.com Scopio Labs gains De Novo clearance for AI bone marrow analysis software and more FDA clearances Mobihealth News Lawsuits filed over software company may drive up rent prices KOAT New Mexico Autodesk, Nemetschek Agree on Greater Interoperability for Design and Construction Software Engineering News-Record Check Point Software Reports 2024 First Quarter Financial Results Check Point Software Generative AI Software Sales Could Soar 6,260%: My Pick for the Best AI Stock to Buy Now (Hint: Not Nvidia) The Motley Fool NASA's Voyager 1 Resumes Sending Engineering Updates to Earth NASA Jet Propulsion Laboratory Best video editing software in 2024 Tom's Guide Kia hoping theft prevention software install event will decease stolen vehicles in Louisville - WDRB Nvidia to buy AI orchestration software provider Run:ai Network World Oracle to leave Austin, move headquarters to Nashville Houston Chronicle Preventing Ransomware Attacks at Scale HBR.org Daily Amsterdam's Rodeo Software declared bankrupt, after fraud allegations rocked the company Silicon Canals Peer Software's multi-master on-prem, cloud and & cross-cloud replication – Blocks and Files Blocks and Files Software Unicorn Navan Builds Out Leadership Team as It Moves Closer to IPO The Wall Street Journal Inside Rubrik's Pitch for Its High-Stakes Software IPO The Information Will AI tools lead to fewer software developer jobs? Technical.ly I work an 8-to-5 job to supplement my esports career Business Insider 11 Best CRM Platforms for Small Business in 2024- businessnewsdaily.com Business News Daily Tesla slashes price for Full Self-Driving software Fox Business Google is combining its Android software and Pixel hardware divisions to more broadly integrate AI The Associated Press ServiceNow Stock: Earnings Beat, Guidance Light. Software Stock Falls Investor's Business Daily Famitsu software sales (4/15/24 - 4/21/24) - Top 30 Nintendo Everything Schneider in Deal Talks With US Software Maker Bentley Yahoo Finance |
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 |