LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2005, 04:51 PM   #1
michaelyu33
LQ Newbie
 
Registered: Mar 2005
Posts: 8

Rep: Reputation: 0
Unhappy Pass SCP User passward in shell program


Need help on pass the SCP user passward in shell program. I have a sample shell program test1.sh and it contains the following:

WRK_FILE=/home/oracle/exp/test.dmp

if [ -e ${WRK_FILE} ];
then
scp ${WRK_FILE} oracle@dataserver.pender.com:/home/oracle/data
###How do I pass the Oracle OS user password in the shell program
fi

Any thoughts!!!
Thanks and have a great day
 
Old 03-17-2005, 06:59 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi, and welcome to LQ!

May I suggest that you use password-less logins for ssh
instead of trying to put a password into the script?

public key authentication with ssh



Cheers,
Tink
 
Old 03-18-2005, 08:15 AM   #3
michaelyu33
LQ Newbie
 
Registered: Mar 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you so much. In our case, we must use password authentication. Because I am transfer data from one production server to another server. Security is the top priority. Is there a way in Shell to solve those kind of problems?
 
Old 03-18-2005, 12:15 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Let's put it that way ... if an attacker will be able to get
the Public-Key-Pairs of the machines he'll be able to
get the password from the script as well. If the boxes
are locked-down via firewalls to the outside world, and
have good security measures physically having the
password in a file is no safer than the public key pair
method.

[edit]
If you're adamant that Public Keys are not an option,
have a look at Perl and get Net::SCP::Expect from CPAN.

Personally I'd prefer the public-key method because
that way the attacker won't be able to figure out how
you chose passwords as a rule of thumb. Reconsider
your approach :) ... should I ask another mod to move
this thread to the security forum instead? I don't think
that the scripting should be your primary concern here.
[/edit]


Cheers,
Tink

Last edited by Tinkster; 03-18-2005 at 12:48 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
which C++ library is used to get the options user pass for program TruongAn Programming 7 07-05-2005 04:56 PM
How to program scp frontend? lasindi Programming 10 10-17-2004 05:45 AM
Shell Script with ssh & scp ErikJohnson Linux - Software 3 03-11-2004 04:53 PM
Shell Script with ssh & scp ErikJohnson Linux - Networking 1 03-11-2004 04:14 PM
pass parameters to shell scripts ? qwijibow Linux - Newbie 2 08-07-2003 07:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration