However, if the remote server listens on a different port, you can specify the port number using the -p option. The ssh-copy-id command copies the public key of your local machine’s ~/.ssh/ directory to the authorized keys file of a remote OpenSSH server on TCP port 22. But, you can pass the -p port to ssh-copy-id. You can ssh-copy-id command to use locally available keys to authorise logins on a remote Linux or Unix machine. Last login: Sat Mar 7 17: 55: 48 2015 from viveks-macbook-pro.local Summing up $ ssh-copy-id -p 2222 state identity file for ec2 server using the -i option # $ ssh-copy-id '-p PORT-NUMBER-HERE ssh-copy-id '-p 2222 ssh-copy-id '-p 2222 use the following syntax: only valid for older ssh-copy-id (see below for new syntax) # If your remote server listen on a different port than 22, you need to use the following syntax: Using ssh-copy-id with an SSH server listening on a different port such as TCP port # 2222 Once you enter the password, the command will copy your public key to the authorized_keys file of the remote user account on the specified port as discussed below. Please note that when you run the above command, the ssh-copy-id will prompt you for the password of the remote Linux or Unix user account. Now try logging into the machine, with: "ssh '"Īnd check to make sure that only the key(s) you wanted were added. usr/local/bin/ssh-copy-id: INFO: 1 key (s ) remain to be installed - if you are prompted now it is to install the new 's password: usr/local/bin/ssh-copy-id: INFO: attempting to log in with the new key (s ), to filter out any that are already installed
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |