Solved

Remote call of a shell script using ftp

Posted on 1998-07-06
9
756 Views
Last Modified: 2013-12-26
I'm pretty sure I can do this, but I can't get it to work:
0
Comment
Question by:JetDiesel
9 Comments
 

Author Comment

by:JetDiesel
Comment Utility
Edited text of question
0
 
LVL 3

Expert Comment

by:dhm
Comment Utility
The SITE EXEC is not implemented on the HP ftp daemon.  (It's listed in the man page, but the daemon responds to a "SITE HELP" command with the list "UMASK   IDLE    CHMOD   HELP" -- EXEC is missing.)  I tried "SITE EXEC" against several other ftp servers (Solaris-5.5.1, IRIX-6.2, and Linux/RH5.1) and only RedHat recognized "SITE EXEC."  (Even RH didn't work -- probably a configuration issue -- but at least it didn't complain about the command.)

Why not re-write the question as "how can I do X?" instead of "how can I use ftp to run a command?" and maybe somebody will have a simple solution.
0
 
LVL 5

Expert Comment

by:n0thing
Comment Utility
You can't do that with ftp, site exec is very limited and is mostly available with wu-ftpd deamon. It has been disabled by
default bacause of security problems. I would recommend you
to use remote shell (rsh), telnet ... to do that.

0
 
LVL 2

Expert Comment

by:blowfish
Comment Utility
What are you trying to do in your shell script prior to the FTP transfer.  Perhaps there's another way...You say that you are writing a script on a Windows machine to do the file transfer.  Will all of this be running unattended when implemented?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Accepted Solution

by:
notanexpert earned 300 total points
Comment Utility
This is a pretty bulky solution .. and requires you to have access to the unix machine (which I assume you have). But theoretically, you could set up a directory on that unix machine that watches for new files. You could upload a textfile as a 'trigger', telling this daemon or whatever to excecute 'blah blah blah'. You could even use the contents of this text file as input to your daemon in case what you actually need to execute changes everytime you log on or whatever.

Now, I've never written a daemon, so I'm not sure how tough that would be. The only other way you co do this is set up a cron job to run every minute or something ... check for the file, and respond with the appropriate action, but that's a pretty messy solution. Basically, this isn't using the FTP protocal or anything to excecute a command, I know, but I think there should be a viable way of setting up some sort of 'trigger' system that would work on the unix end and watch for some particular upload 'key'.
0
 
LVL 1

Expert Comment

by:ksb
Comment Utility
You can build a named pipe.  Attach the process to get the data to the named pipe and put stuff on the pipe.  Your FTP server might block puts to a pipe, but that could be fixed.

You could even use a portal filesystem .... but that would be using Nukes in a fish tank.

0
 
LVL 8

Expert Comment

by:MaDdUCK
Comment Utility
No luck yet?
0
 
LVL 1

Expert Comment

by:arbitrary
Comment Utility
Remote call of a shell script using ftp are just two things completely different embedded into one sentence you might execute shell command using ftp-daemon but that's a hole in the ftp-daemon the FileTransferProtocol is for transfering file
and not subsitue RPC which stands for remote process calls ,
and is being implemented on every POSIX unix system

0
 
LVL 1

Expert Comment

by:arbitrary
Comment Utility
Remote call of a shell script using ftp are just two things completely different embedded into one sentence you might execute shell command using ftp-daemon but that's a hole in the ftp-daemon the FileTransferProtocol is for transfering file
and not subsitue RPC which stands for remote process calls ,
and is being implemented on every POSIX unix system

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now