- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: removing files via SSH
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
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
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
тАО07-27-2009 11:28 AM
тАО07-27-2009 11:28 AM
But I can't get the ssh command to remove the files on the vendor site. Here's the command I'm trying.
ssh -i /ssh/serverkey customer@fts.vendor.com rm /outbound/clientfiles*07*09*
When I issue this command, it just comes back to the command prompt with no message at all, and the files are still there.
I have rights to remove these files and can remove them if I manually log in to the sftp site.
Should what I'm trying work?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2009 11:43 AM
тАО07-27-2009 11:43 AM
Re: removing files via SSH
rsync -avH --stats --delete -e ssh invest@mercury.investmenttool.com/var/httpd/ /web/
--delete # deletes files at the destination deleted at the source
-e ssh uses ssh and therefore permits public key password exchange.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2009 11:45 AM
тАО07-27-2009 11:45 AM
Solutionssh -vvv -i /ssh/serverkey customer@fts.vendor.com rm /outbound/clientfiles*07*09*
and post the output here please. But I believe, your vendor may be to blame here. They mihgt be sensing the ssh logins and putting you to an exit command directly. Are you sure you are allowed to go in via ssh ? In other words, if you run:
ssh -i /ssh/serverkey customer@fts.vendor.com
do you get a shell prompt ?
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2009 12:22 PM
тАО07-27-2009 12:22 PM
Re: removing files via SSH
I don't get a shell prompt so I think I'll go back to the vendor for some assistance. Here's the pertinent part of the output when I use the -v
debug1: Next authentication method: publickey
debug1: Offering public key: /ssh/serverkey
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: channel 0: free: client-session, nchannels 1
Connection to fts.jpmchase.com closed.
debug1: Transferred: stdin 0, stdout 0, stderr 40 bytes in 0.0 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 4150.3
debug1: Exit status -1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2009 12:33 PM
тАО07-27-2009 12:33 PM
Re: removing files via SSH
Good luck....
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2009 03:36 PM
тАО07-27-2009 03:36 PM
Re: removing files via SSH
If no matches are found, what happens next depends on your shell configuration: some shells will then run the command line as-is, with the wildcards un-expanded. That may be happening here, as the ssh command gets invoked. Other shells may explicitly display an error message.
But if the un-escaped wildcard expression matches on your local host, the shell will blindly follow its programming and expand it to the list of matched filenames on local host, which is not what you want at this time.
Put backslashes in front of the wildcards to make sure they'll survive intact to the remote system.
ssh -i /ssh/serverkey customer@fts.vendor.com rm /outbound/clientfiles\*07\*09\*
If that does not work, the remote account may be set up with a "scponly" pseudo-shell which ignores any non-scp commands. If this is the case, your only possibility is to use the batch mode of sftp:
--------------------------
#!/bin/sh
sftp -o IdentityFile=/ssh/serverkey -b - customer@fts.vendor.com <
exit
EOF
--------------------------
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2009 09:00 AM
тАО07-28-2009 09:00 AM
Re: removing files via SSH
Yours is the first response to show the -o IdentityFile option as part of the way to use sftp in a batch mode as part of a script. It's not in the man pages or any thread I could find on the ITRC.
Now instead of using scp I can just use sftp to both transfer the files and remove them from the vendor's site.
Muchas Gracias!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2009 09:43 AM
тАО07-28-2009 09:43 AM
Re: removing files via SSH
The "-o" option itself should be documented
clearly enough, but more digging may be
needed to expose what the SSH options might
be which you can pass through it.
dy # sftp -h
Usage: sftp [options] user@host[:file [file]]
Options:
[...]
-o ssh_option Used to pass options to ssh in the format used in ssh_config file.
[...]
"man ssh_config" knows all, tells all.