Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ssh-copy-id(1) [freebsd man page]

SSH-COPY-ID(1)						    BSD General Commands Manual 					    SSH-COPY-ID(1)

ssh-copy-id -- copy public keys to a remote host SYNOPSIS
ssh-copy-id [-lv] [-i keyfile] [-o option] [-p port] [user@]hostname DESCRIPTION
The ssh-copy-id utility copies public keys to a remote host's ~/.ssh/authorized_keys file (creating the file and directory, if required). The following options are available: -i file Copy the public key contained in file. This option can be specified multiple times and can be combined with the -l option. If a private key is specified and a public key is found then the public key will be used. -l Copy the keys currently held by ssh-agent(1). This is the default if the -i option was not specified. -o ssh-option Pass this option directly to ssh(1). This option can be specified multiple times. -p port Connect to the specified port on the remote host instead of the default. -v Pass -v to ssh(1). The remaining arguments are a list of remote hosts to connect to, each one optionally qualified by a user name. EXIT STATUS
The ssh-copy-id utility exits 0 on success, and >0 if an error occurs. EXAMPLES
To send a specific key to multiple hosts: $ ssh-copy-id -i /path/to/ user@host1 user@host2 user@host3 HISTORY
The ssh-copy-id utility was written by Eitan Adler <> as a drop-in replacement for an existing utility included with OpenSSH. BSD
February 28, 2014 BSD

Check Out this Related Man Page

SSH-COPY-ID(1)						      General Commands Manual						    SSH-COPY-ID(1)

ssh-copy-id - install your public key in a remote machine's authorized_keys SYNOPSIS
ssh-copy-id [-i [identity_file]] [user@]machine DESCRIPTION
ssh-copy-id is a script that uses ssh to log into a remote machine (presumably using a login password, so password authentication should be enabled, unless you've done some clever use of multiple identities) It also changes the permissions of the remote user's home, ~/.ssh, and ~/.ssh/authorized_keys to remove group writability (which would oth- erwise prevent you from logging in, if the remote sshd has StrictModes set in its configuration). If the -i option is given then the identity file (defaults to ~/.ssh/ is used, regardless of whether there are any keys in your ssh-agent. Otherwise, if this: ssh-add -L provides any output, it uses that in preference to the identity file. If the -i option is used, or the ssh-add produced no output, then it uses the contents of the identity file. Once it has one or more fin- gerprints (by whatever means) it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the file, and directory, if necessary) SEE ALSO
ssh(1), ssh-agent(1), sshd(8) OpenSSH 14 November 1999 SSH-COPY-ID(1)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Help]RegEx, Putty, Copy Files Insensitive Matching, SSH

Alright, basically we're in the whole where we can't tar/gzip a folder since its to big so how do I copy files to a new folder for example I got files from a-Z, i want to copy all files which starts with a A or a into another folder heres file structure ./backups/A ./backups/B... (11 Replies)
Discussion started by: Lamonte
11 Replies

2. UNIX for Dummies Questions & Answers

Move file from 1 server to another

I have built out 2 servers on the same LAN. I'm connecting with ssh from my laptop remotely. I need to copy a file from one server to another. How do I do that? I'd also like to know how to copy a directory. thanks. (11 Replies)
Discussion started by: woody62
11 Replies

3. Shell Programming and Scripting

Copy a file on remote servers

Hey Unix Gurus, I'm having trouble in copying a file on 5 different servers, first how can you do it locally (i.e without the need to ssh to the server you want to copy the file) and if you need to ssh how do u run a command within that server. Please see my code below(it doesn't work somehow).... (10 Replies)
Discussion started by: sexyTrojan
10 Replies

4. AIX

OpenSSH always ask for password

Hello together, I have a Problem with openssh on AIX 5.3. We have a big amount of AIX-hosts that run with openssh but one donīt! Every time we try to connect via ssh to the host, we get a password prompt. The myth ist, that there is no Error or somthing else. Here the output of ssh -vvvv to... (14 Replies)
Discussion started by: heifei
14 Replies

5. Red Hat

SSH keys are not working

Hi, I've generated and posted pub. keys in the source system and the target. However, it is still prompting me for the password. Steps that I have taken. 1. Generated ssh keys : ssh-keygen. It created two files. 1. .ssh/id_rsa 2. .ssh/ 2.... (10 Replies)
Discussion started by: Afi_Linux
10 Replies

6. Solaris

Help with executing multiple remote commands after multiple hops

Hi SSHers, I have embedded this below code in my shell script.. /usr/bin/ssh -t $USER@$SERVER1 /usr/bin/ssh $USER2@S$SERVER2 echo uptime:`/opt/OV/bin/snmpget -r 0 -t 60 $nodeName system.3.0 | cut -d: -f3-5` SSH to both these servers are public-key authenticated, so things run... (13 Replies)
Discussion started by: LinuxUser2008
13 Replies

7. Shell Programming and Scripting

SSH w/ command in authorized_keys apparently needs pty

I'm trying to have an unattended remote PC log some data on home PC. man sshd says I should be able to put a command in authorized_keys. This is what I have on the remote machine. The key is a special key that isn't used elsewhere. In my ~/.ssh/authorized_keys file on my desktop:... (12 Replies)
Discussion started by: KenJackson
12 Replies

8. Shell Programming and Scripting

sftp is asking password

Hi i have generate public private key pair using command ssh-keygen -t rsa -b 2048 and then it made the two keys under the directory ~/.ssh ( in server 1) one is public key and another one is private .. i copied public one key onto my second server under the directory ... (22 Replies)
Discussion started by: aishsimplesweet
22 Replies

9. Shell Programming and Scripting

Cannot create variables via ssh on remote machine

Hello to all Background info: Local machine : Linux, /bin/bash Remote machine (for the user used for ssh) : SunOs, /bin/ksh (so we have different OS, different Shells) My problem : From the local host i execute $ var=bla $ result=$(ssh -q user@remote-machine " > echo \"this is... (12 Replies)
Discussion started by: black_fender
12 Replies

10. Shell Programming and Scripting

ksh script with Interactive ssh on remote server

HI Unix Gurus, I an stuck in an interesting issue, where I am trying to execute a script on remote server after ssh. The script on remote server is interactive,. Whenever it is called it hangs where it expects input from terminal and I have to terminate it. I have searched through fourm... (12 Replies)
Discussion started by: Jeevanm
12 Replies

11. Red Hat

SSH Keys between RHEL 5 and Solaris 10

Hi all Has anyone ever successfully set up ssh key pairs for "passwordless" logins between rhel and Solaris? I've set it up many times before between Solaris systems but i'm having difficulty doing between the two OS's in question. What I have done so far is append the contents of the rhel... (30 Replies)
Discussion started by: notreallyhere
30 Replies

12. Programming

Using Commands over SSH using Sudo

Is there a way to transfer my sudo password via ssh so that I can copy files remotely and pass them locally, so: cat sudo-passwd-file|ssh -t user@ 'sudo find / -depth|cpio -oacv|gzip' > /path/to/dir/file.cpio.gz I am in the process of a creating a script. Everytime I try and just... (16 Replies)
Discussion started by: metallica1973
16 Replies

13. UNIX for Dummies Questions & Answers

SCP requests password despite common key

I created both a DSA and an RSA key for communication between two SSH servers. Each server has the same DSA and RSA key in their .ssh folders. Yet when copying files from one server to another using a client terminal, I get a password prompt. Why is that? What should I do to bypass the password... (18 Replies)
Discussion started by: SNorton
18 Replies

14. Shell Programming and Scripting

How to write bash script for creating user on multiple Linux hosts?

I wonder whether someone can help me with what I'm trying to achieve Basically, the objective is one script to create new user on more than 70 linux hosts if required. Everything works apart from the highlighted part. It gave me an output passwd: Unknown user name ''. when try to set... (35 Replies)
Discussion started by: fugeulu
35 Replies

15. Shell Programming and Scripting

Pass path variable on SSH

hi Gurus, Have been struggling with this for a while I have 2 servers , lets say local A and remote B, I need to use both as a part of a pipeline. The folder structure is shared between the two, so I can access the same files and folders from both A and B. When I try to ssh into B from A,... (15 Replies)
Discussion started by: senhia83
15 Replies