- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SFTP without password in scripts
Operating System - HP-UX
1824976
Members
4032
Online
109678
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО03-18-2009 11:00 AM
тАО03-18-2009 11:00 AM
SFTP without password in scripts
There are two servers.
1. SSH server
2. Client Server
I need to run the script from ssh server to client server using sftp.
Problem:
When i run the scripts its asking password.
ssh01# ./do_cfg
Connecting to client01...
Password:
content of do_cfg script:
#!/bin/sh
#
HOSTNAME=`hostname`
cp -p /usr/local/bin/.netrc $HOME
cd /usr/local/data/
sftp client01 < cd /depot/
put *gz
EOF
rm $HOME/.netrc
content of .netrc:
ssh01# more .netrc
machine client01 login root password *******
Without asking password i need to run the script
Kindly suggest me how to proceed further.
1. SSH server
2. Client Server
I need to run the script from ssh server to client server using sftp.
Problem:
When i run the scripts its asking password.
ssh01# ./do_cfg
Connecting to client01...
Password:
content of do_cfg script:
#!/bin/sh
#
HOSTNAME=`hostname`
cp -p /usr/local/bin/.netrc $HOME
cd /usr/local/data/
sftp client01 <
put *gz
EOF
rm $HOME/.netrc
content of .netrc:
ssh01# more .netrc
machine client01 login root password *******
Without asking password i need to run the script
Kindly suggest me how to proceed further.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2009 11:05 AM
тАО03-18-2009 11:05 AM
Re: SFTP without password in scripts
Hi:
See my commentary here:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1302924
Regards!
...JRF...
See my commentary here:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1302924
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2009 11:51 AM
тАО03-18-2009 11:51 AM
Re: SFTP without password in scripts
Hi,
You need to setup password less login before run the script.
- logon to serverA as user doing transfer
- ssh-keygen -t dsa
- cat ~/.ssh/id_dsa.pub (copy contents)
- logon to serverB as user doing transfer
- cd ~/.ssh
- vi authorized_keys (paste contents from key above)
Make sure the following permissions are set in destination server(Server B in your case)
Home directory should have 755 permission (users home directory)
$HOME/.ssh directory should have 700 permission
$HOME/.ssh/authorized_keys file should have 600 permission
Refer this thread as well..
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1310366
You need to setup password less login before run the script.
- logon to serverA as user doing transfer
- ssh-keygen -t dsa
- cat ~/.ssh/id_dsa.pub (copy contents)
- logon to serverB as user doing transfer
- cd ~/.ssh
- vi authorized_keys (paste contents from key above)
Make sure the following permissions are set in destination server(Server B in your case)
Home directory should have 755 permission (users home directory)
$HOME/.ssh directory should have 700 permission
$HOME/.ssh/authorized_keys file should have 600 permission
Refer this thread as well..
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1310366
Best wishes,
Ganesh.
Ganesh.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP