Unix Technical Forum

sftp script for application promotion

This is a discussion on sftp script for application promotion within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> Hi, I am new to sftp/ssh. I need to find a way to create and run an sftp script ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 10:18 AM
zubairom@gmail.com
 
Posts: n/a
Default sftp script for application promotion

Hi,

I am new to sftp/ssh. I need to find a way to create and run an sftp
script on a Solaris host, which can read input from a paramter file,
for paths/directories/files to be migrated to another Solaris host, and
execute the transfers.

Also how can I avoid entering password interactively. Is there
something like .netrc, or I have to use public_keys. If I need to use
public_keys how may I use them?

I read some posts onsome of the groups where they talk about
public_keys ect, but I am totally new, and would appereciate if someone
can guide me in acomplishing this, given that I have minimal knowledge
expereience of ssh.


Thanks

Omer

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 10:19 AM
Dave (from the UK)
 
Posts: n/a
Default Re: sftp script for application promotion

zubairom@gmail.com wrote:
> Hi,
>
> I am new to sftp/ssh. I need to find a way to create and run an sftp
> script on a Solaris host, which can read input from a paramter file,
> for paths/directories/files to be migrated to another Solaris host, and
> execute the transfers.
>



You don't have such things as sftp scrips. You can create a shell script (/bin/sh)
and execute that on the remote machine via ssh

$ ssh user@remotehost /path/to/script


> Also how can I avoid entering password interactively. Is there
> something like .netrc, or I have to use public_keys. If I need to use
> public_keys how may I use them?


Lets assume you want to log into a remote host 'duke' from a workstation
'sparrow' using ssh with no password.

1) Create a pair of keys on sparrow

sparrow $ ssh-keygen -t dsa

have an empty pass phase

That will create $HOME/.ssh/id_dsa.pub (public key) and
$HOME/.ssh/id_dsa


2) *Append* $HOME/.ssh/id_dsa.pub from sparrow to $HOME/.ssh/authorized_keys on duke.
If $HOME/.ssh/authorized_keys does not already exist (which it will not if
you have not set it up before), then you just copy it.

sparrow $ scp $HOME/.ssh/id_dsa.pub user@duke:/tmp
sparrow $ ssh user@duke

log into duke.

duke $ cat /tmp/id_dsa.pub >> $HOME/.ssh/authorized_keys
duke $ rm /tmp/id_dsa.pub

Next time, you can log in with no password, as you can see
below.

sparrow /export/home/drkirkby % ssh duke.medphys.ucl.ac.uk
Last login: Fri Mar 10 17:38:15 2006 from 213-78-42-15.pp

SunOS Release 5.8 Version Generic_117350-13 (duke) sun4u


> I read some posts onsome of the groups where they talk about
> public_keys ect, but I am totally new, and would appereciate if someone
> can guide me in acomplishing this, given that I have minimal knowledge
> expereience of ssh.


Google on it. There is a lot on it, but it is a bit confusing at first it
must be said.


--
Dave K

Minefield Consultant and Solitaire Expert (MCSE).

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 10:19 AM
zubairom@gmail.com
 
Posts: n/a
Default Re: sftp script for application promotion

Thanks Dave, I will try

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 10:19 AM
Claus Dragon
 
Posts: n/a
Default Re: sftp script for application promotion

Words to the wise, "Dave (from the UK)"
<see-my-signature@southminster-branch-line.org.uk> wrote:

>zubairom@gmail.com wrote:
>> Hi,
>>
>> I am new to sftp/ssh. I need to find a way to create and run an sftp
>> script on a Solaris host, which can read input from a paramter file,
>> for paths/directories/files to be migrated to another Solaris host, and
>> execute the transfers.
>>

>
>
>You don't have such things as sftp scrips. You can create a shell script (/bin/sh)
>and execute that on the remote machine via ssh


You can create batch files with sftp though, the batch file (i.e. the
paths to the files and the files) would have to be created otherwise.

To do this interactively, set up a key pair for a separate user which
only is allowed to do what the script does.
--
Claus Dragon <clauskick@mpsahotmail.com>
=(UDIC)=
d++ e++ T--
K1!2!3!456!7!S a26
"Coffee is a mocker. So, I am going to mock."

- Me, lately.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:24 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com