- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: regarding SFTP
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
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
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-23-2004 03:00 PM
06-23-2004 03:00 PM
I am trying to SFTP some files thru Ksh I want to run the script(see below) thru scheduler. If I run this script it prompts for the password, Is there any way that it could be automated or read thru some file.
I know we could do it in FTP but FTP is not an option .. i HAVE to use SFTP
Please let me know if there is any way
#!/usr/bin/ksh
$INFILE="Input.txt"
while read -r i
do
cd /home/$i/logs
/usr/bin/sftp user@host <
put *.log
quit
EOF
done<$INFILE
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 09:24 PM
06-23-2004 09:24 PM
SolutionThe next best way is to set up a key pair, with a blank passphrase. This is still secure data transfer, but if the keys are compromised, so is access.
The poorest way is to use an "expect" script. You can get expect from the HP porting center.
Regards, Simon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2004 02:30 AM
06-24-2004 02:30 AM
Re: regarding SFTP
Thanks for the response.
I have couple of questions,
How could i do that if I have to SFTP files from 6 different server to one single server??
How is SCP ? Is it different from SFTP?
Is that an option ?
Appreciate your feedback
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2004 02:42 AM
06-24-2004 02:42 AM
Re: regarding SFTP
You need to authentication to exchange of public/private keys.
Generate the keys. ssh-keygen -t dsa
It will create the public and private keys. (*.pub) is pubic key.
Put this key in server_where_you_want_to_sftp/scp:$HOME/.ssh/authorized_keys.
Do not do cut/paste business to copy the key to authorized_keys file. Transfer the *.pub file by ftp/sftp/scp/rcp etc.
Once you are set for authentication to exchange of private/public keys, use your code to pull the files from all 6 servers to one server.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2004 02:42 AM
06-24-2004 02:42 AM
Re: regarding SFTP
For the difference between SCP and SFTP, see:
http://www.cam.ac.uk/cs/filetransfer/compare.html
HTH.
Regards,
Sri Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2004 02:46 AM
06-24-2004 02:46 AM
Re: regarding SFTP
scp is the rcp replacement that is secure, it is part of openssh.
Here is how you script it
$LOGDIR=/home$i/logs
cd $LOGDIR
scp *.log user@hostname://directory
You can do this password free if you follow the document I am giving you to exchange publickeys between the two servers.
You can use cat, the doc says use X but you can do it all with cat commands.
see doc
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
06-24-2004 04:59 AM
06-24-2004 04:59 AM
Re: regarding SFTP
thanks it works between my test server for me here..
But the remote server I have access to doesnt have my $HOME directory.
I could put the authorized_key files in one of the folder ? In this case how does this work??
Please let me know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2004 07:42 AM
06-24-2004 07:42 AM
Re: regarding SFTP
You don't have a home directory in the remote server for the login name?
Is it for only to do the sftp or something?
I think if the remote server is running ssh1, it expects the key files to be in the ~/.ssh directory.
But if it is ssh2, thre is a parameter called "UserConfigDirectory", which need to be setup in their sshd_config file. But the catch is this is a system wide parameter and all user's authorized keys file location would change.
Here is the excerpts from a ssh documentation,
5.4.1.5. User SSH directory
sshd1 expects a user's SSH-related files to be found in the directory ~/.ssh. This location can't be changed by serverwide configuration. (You have to modify the source code.)
sshd2 expects user files to be in the directory ~/.ssh2 by default, but this can be changed with the UserConfigDirectory keyword. The directory name may be literal, as in:
# SSH2 only
UserConfigDirectory /usr/local/ssh/my_dir
or it may be specified with printf-like patterns, as in:
# SSH2 only
UserConfigDirectory %D/.my-ssh
The %D pattern expands to the user's home directory. So the preceding example expands to ~/.my-ssh. The following table shows the available patterns:
Here is the full link,
http://216.239.51.104/search?q=cache:AdvSrye6xRkJ:secu.zzu.edu.cn/book/NetWork/NetworkingBookshelf_2ndEd/ssh/ch05_04.htm+ssh+userconfigdirectory&hl=en
HTH,
Abdul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2004 08:01 AM
06-24-2004 08:01 AM
Re: regarding SFTP
Don't know, if this will work or not.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2004 10:17 AM
06-24-2004 10:17 AM
Re: regarding SFTP
A. I creatd .ssh/authorized_keys under A doesnt help.. and also authorized_keys under A (just for the heck of it) ..
Truly appreciate all of your help.. learnt a lot from this thread.
Any solution is always welcome .. If i find any solution I would post it ..Last optionis to try expect which I would try to avoid..
thanks a lot..
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2004 02:41 AM
06-25-2004 02:41 AM
Re: regarding SFTP
We also are implementing SFTP; our problem is
converting our customers from the GUI WS_FTP
that I believe uses anonymous ftp, to WINSCP
GUI. Problem is preventing the customer from transversing up the directory. We have read the numerous 'chroot jail' solutions, but it seems so 'messy'. We have a common
directory for all customers who can transverse many different subdirectories. Permissions is not a viable alternative.
We are soliciting comments/best practices /solutions.
Thank you in advance