Re: [OT] ssh login script - Please Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mikkel L. Ellertson wrote:
Mike Burger wrote:
Mikkel wrote:
Or don't log in at all. Use scp to copy the file, and then ssh where
it is set to run a command when you connect. (Use the
comand="comand" format for the key.) One thing I am not sure of is
if you can use the same key for scp when using the command= option.
Well, is part of the openssh suite, and does/will use the same key as the
ssh executable.

I use keys to scp and ssh to run commands all the time, without having to
pass passwords along, in order to automate processes, all the time.

I do the same. But I have never tried to use the private key that
was tied to a command on the other machine with scp, so I do not
know if scp will work with a key that is only allowed to run one
program on the remote machine. (You can not "login" in using that
key.)

[ forgive my mid-line snip of your example ]

You don't need to do two operations, you can pass the file to the script:
  cat myfile | ssh -i myscript.key machine [optional args]
the first command in the script is something like:
  dd of=safedir/new.myfile

You can pass arguments to the script, they will end up in $SSH_ORIGINAL_COMMAND which can be read by the script. My backup script takes full|incr|config|logs|crit argument on the client and sends the backup data to stdout where I can save it.

--
Bill Davidsen <davidsen@xxxxxxx>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux