- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Execute commands through a ftp session
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2002 12:05 PM
тАО06-05-2002 12:05 PM
Execute commands through a ftp session
Is there anyway to run commands on remote server through a ftp session.
The commands that I wanto to run is tail and head redirectind the outputo to another file.
tail file > output_file
head file > output_file
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2002 12:19 PM
тАО06-05-2002 12:19 PM
Re: Execute commands through a ftp session
Hi I havent done this thro ftp and I think that it is not possible.
You can do rsh and remsh instead. Go thro
man remsh and rsh.
# rsh -n -l username hostname
tail file > filename
# remsh hostname tail file > filename
# remsh -n -l username hostname
tail file > filename
Piyush
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2002 12:33 PM
тАО06-05-2002 12:33 PM
Re: Execute commands through a ftp session
Not possible by ftp command I have a idea
ftp > !command
command can be
remsh server name tail file > output_file
remsh server name head file > output_file
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2002 01:13 PM
тАО06-05-2002 01:13 PM
Re: Execute commands through a ftp session
No, this is not possible, and this is by design. It would be a severe security risk if ftp users could break out of the ftp shell remotely & execute commands on the remote system.
What I would suggest to you is to use "!" to shell out to the local system & run a remsh command to do what you wish on the remote system. Then just exit afterwards & you're still in your ftp session. This way you're not compromising any security features & you're not terminating your ftp session.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2002 01:47 PM
тАО06-05-2002 01:47 PM
Re: Execute commands through a ftp session
and do whatever you wish, if the files are not to big. Otherwise it its remsh,rcp, uucp, depending of the need
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2002 01:52 PM
тАО06-05-2002 01:52 PM
Re: Execute commands through a ftp session
when logged, would perform the tail/head operations and ftp the results back!
So in the etc/passwd, instead of a shell path, it'd be the path to script doing the trick
ftp.sh
tail file >output
head file >output
ftp -n -i
exit
ftp.cmd would contain
ftp server user passwd
cd favorite_dir
put output there
bye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2002 04:00 PM
тАО06-05-2002 04:00 PM
Re: Execute commands through a ftp session
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2002 03:54 AM
тАО06-06-2002 03:54 AM
Re: Execute commands through a ftp session
What is the sintax to run a commando directing the outputo to another file?. I executed the command "SITE EXEC TAIL > OUTPUT_FILE", but it didnt work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2002 04:05 AM
тАО06-06-2002 04:05 AM
Re: Execute commands through a ftp session
On the remote server put a small script to check the existance of a file "go.flag" so that when this file exits it does the tail routines sending the output to a file and then remove the go.flag file and go back to looking for "go.flag".
From the local server ftp to remote, put go.flag (the remote script will now run) and then "get" the results of the tail file.
Simple - no security holes opened.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2002 04:14 AM
тАО06-06-2002 04:14 AM
Re: Execute commands through a ftp session
tail -n 200 filename > outfile #
tail -n 200 filename >> outfile # Append to file
Will tail the last 200 lines abd redirect the output to outfile.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2002 05:42 AM
тАО06-06-2002 05:42 AM
Re: Execute commands through a ftp session
I found the solution I was lookin for.
The sintaxe to execute SITE EXEC command on ftp prompt is just "SITE EXEC
The trick is that the command that has to be executed though ftp SITE EXEC command, must be in /etc/ftpd/ftp-exec directory.
Thanks a lot for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 11:58 AM
тАО06-12-2002 11:58 AM
Re: Execute commands through a ftp session
I know you have your solution but
here is another to consider -
We perform a multitude of these -
From ftp call an executable script.
ftp xxxx
login_name
pass_word (or use a .netrc file)
EXEC /path_to_executable/executable_script
quit
Work for all executables we wish to start though site exec should work as well.
dl