mscp man

MSCP(1)                                                                                                                                         MSCP(1)

NAME
mscp – multiple secure copy program

SYNOPSIS
mscp [options]

DESCRIPTION
mscp  is  a  command-line  tool for distributing files to multiple hosts at once. It wraps around classic scp program to distribute single or multiple files via scp to
remote hosts. It’s best used in comination with ssh key autentification. One must first generate ssh rsa or dsa key, and associate that key with remote servers.   mscp
will  add  your  key  to ssh-agent and will promt you for passphrase (if it’s set) only once. Upon completition of transfering data mscp will remove your key from ssh-
agent.  mscp will work even without key auth, but you will be constantly prompted for server passwords.

OPTIONS
-h, –help
Shows the help screen.

Mandatory options:

-l or –listfile <listfile>
mscp searches for listfile in /home/[username]/.serverlist/ Listfile should contain hostnames of remote servers (one per line) on which you wish  to  distribute
files. Alternatively you can provide -f option and full path to listfile.

-s or –source <source>
Selects  local files or directories to distribute among hostnames provided in listfile. If source is a directory use -r option. If you need to use shell regexps
in filenames use quotations, for example:

mscp -l servers -s “*.tar.gz” -d /usr/src

-d or –destination <destination>
Select the destination directory.

Optional parameters:

-r or –recrusive
Recrusive, must be used when source is a directory.

-k or –key <keyfile>
Selects local ssh keyfile to use for authentication on remote hosts. If omitted, default identity key file will be used as explained in ssh-agent manual page.

-u or –username <username>
Sets the username to be used when authenticating on remote hosts, if omitted local username will be used.

EXAMPLES:
Daily usage examples:

mscp -l servers -s nagios.tar.gz -d /usr/src

Will transfer local file nagios.tar.gz to remote hosts listed in /home/username/.serverlist/servers ,destination dir will be /usr/src

Let’s say you wish to update server scripts on 40+ hosts, you can do it simply by typing

mscp -l all40hosts -s “*.sh” -d /root/scripts/ -u root

this will copy all local .sh files into remote directory /root/scripts/ using username root on remote end.

If you use multiple ssh keyfiles you can instruct mscp to put your specific keyfile into ssh-agent.

mscp -f /home/branko/tempservers -k /home/branko/.ssh/rootkey -u root -r -s scripts/ -d /root/

This command will put my ssh rootkey in ssh-agent, and will distribute entire scripts/ directory recursively to destination directory /root/ on  servers  specified  in
file /home/branko/tempservers

AUTHOR
This manual page was written by Branko Toic <branko@toic.org> for the Debian system (but may be used by others).  Permission is granted to copy, distribute and/or mod‐
ify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation On  Debian  systems,  the
complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.

Homepage: http://toic.org/mscp/

SEE ALSO
ssh-agent(1) ssh(1) scp(1)

Version 1.0                                  Nov 2008                                                                  MSCP(1)

  1. No comments yet.

  1. No trackbacks yet.