sftp script for application promotion
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > sftp script for application promotion




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    sftp script for application promotion  
zubairom@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-10-06 10:57 PM

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






[ Post a follow-up to this message ]



    Re: sftp script for application promotion  
JohnK


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-11-06 12:48 PM

zubairom@gmail.com wrote:
> 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.

As a simple guide...

Ssh connects from one account to another remote account.  You need to do
some actions on both accounts before you can connect using keys.

Local account
On the sender account create your key (unless it exists already) using -
ssh-keygen -t dsa
It will prompt you for a passphrase.  Press enter twice to have a blank
passphrase.
This produces two files ~/.ssh/id_dsa and ~/.ssh/id_dsa.pub
cat the file ~/.ssh/id_dsa.pub out and select it so it is in the clipboard.

Remote account
Now in another session window, log into the remote account.  Create the
~/.ssh directory and edit/create the file ~/.ssh/authorized_keys.  Paste
in the key from your clipboard.  It should all be on one line.
Make sure the authorized_keys file is owned by the remote account and
set the permissions to 600.

Test connection
Now try to ssh from the sender account to the remote account
ssh remoteaccount@remotebox
If this is the first time you have connected using this method then it
will prompt you to confirm you accept this box is the correct one.  You
need to type in 'yes' in full.  It 'should' then log you in without a
password.  Once this is working then you should also have a working sftp
connection.

Problems
Ssh is very fussy about security and permissions etc.  It may refuse to
connect with a key if the remote account's home directory has incorrect
permissions or for other reasons.  If it refuses to connect then you can
get more information about the problem by running sshd on the remote
server using the command
/usr/sbin/sshd -p 8081 -d
and then trying the connection again but using the command
ssh -p 8081 -v remoteaccount@remotebox

Notes:  Depending on the UNIX platform, the path to sshd may be
different.  This method may not work for root accounts depending on the
settings in the sshd_config file.  Use another account.

JohnK





[ Post a follow-up to this message ]



    Re: sftp script for application promotion  
zubairom@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-16-06 10:53 PM

Thanks John. This helped






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:27 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register