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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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. |
| ||||
| 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. |
| Thread Tools | |
| Display Modes | |
|
|