07-05-2012
Creating the key:
The following command was run on both servers and on the local client in separate terminals.
ssh-keygen -t dsa
I pressed enter three times to create the files .ssh/id_dsa and .ssh/id_dsa.pub. I then performed the following command on both servers.
scp .ssh/id_dsa.pub [user@hostname]:.
I entered my password for the scp command and copied the key from each server onto the other.
cat id_dsa.pub >> .ssh/authorized_keys
This installed the key on the servers.
Next, I copied the key from my local client onto both servers and installed them in the same way. Finally, I performed the following commands for each server on the local client:
scp [user@hostname]:.ssh/id_dsa.pub . ; cat id_dsa.pub >> authorized_keys
All machines are authorized to view and copy files on one another. The local client is able to share files between both servers with no password input. One server is able to copy files from the other with no password input. However, the second server is unable to copy files from the first without password input. And when I do enter the password, it breaks the operation.
EDIT: I'm a complete newbie. What do you mean by "must be 755" or "must be 700"?
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I am trying to scp a file from our Unix server to the local Windows machine.I have created the key pair in Unix server using ssh-keygen command in unix.
But I am not sure where can we put the public key(generated on Unix) in Windows machine so that scp from Unix machine to Windows is... (3 Replies)
Discussion started by: dennis.jacob
3 Replies
2. UNIX for Dummies Questions & Answers
Hello all,
My first post in this forum.
I am trying to download a file from a server to which I have been granted access. They setup a DSA public key and I have a local private key.
When i try to download the file it prompts me for my password.
How can I tell unix to use the DSA key... (1 Reply)
Discussion started by: who2
1 Replies
3. Shell Programming and Scripting
Hi all
I have some 106 users of which i need to change the password of them to a common one. I dont know their paswword. But i need to reset them to a common one. How can i do this with a shell script? It would be a great help if some one can help to sort out this.:b::b:
I know it can be... (0 Replies)
Discussion started by: Tuxidow
0 Replies
4. Shell Programming and Scripting
Hi,
I'm trying to copy a file from one server to remote server using SCP command. Below is the command i tried and got host key not found in database errror.
scp sendfile.txt Remoteserver:/home/xxxx/.
Error Message:
Host key not found from database
Key fingerprint:... (2 Replies)
Discussion started by: skcvasanth
2 Replies
5. Shell Programming and Scripting
I've been a Unix admin for nearly 30 years and never learned AWK. I've seen several similar posts here, but haven't been able to adapt the answers to my situation. AWK is so damn cryptic! ;)
I have a single file with ~900 lines (CSV list). Each line starts with an ID, but with different stuff... (6 Replies)
Discussion started by: protosd
6 Replies
6. UNIX for Dummies Questions & Answers
Hi,
What tool is used to generate public and private keys for SCP?
Do you have an example script that generates these keys, puts them in files and then another example script that references them from SCP?
Thanks, (9 Replies)
Discussion started by: Astrocloud
9 Replies
7. UNIX for Advanced & Expert Users
Hi All,
I have setup ssh keys for a user to transfer files without password between two hosts. But still the first time scp asks for confirmation and generates a key
Due to this our jobs are failing.
Is there a way I can avoid that first time key generation and confirmation also and automate... (3 Replies)
Discussion started by: baanprog
3 Replies
8. UNIX for Dummies Questions & Answers
Hi, I am trying to selectively merge two files based on keys reported in the 1st column.
File1:
#file1-header1
file1-header2
111 qwe rtz uio
198 asd fgh jkl
165 yxc
789 poi uzt rew
89 lkj
File2:
#file2-header2
file2-header2
165 ghz nko2 ... (2 Replies)
Discussion started by: dovah
2 Replies
9. Shell Programming and Scripting
Hi,
I am trying to join 2 csv files, to create a 3rd output file with the joined data.
Below is an example of my Input Data:
Input File 1
NAME, FAV_FOOD, FAV_DRINK, ID, GENDER
Bob, Fish, Coke, 1, M
Lisa, Rice, Water, 2, F
Jenny, Noodle, Tea, 3, F
Ken, Pizza, Coffee, 4, M
Lisa,... (7 Replies)
Discussion started by: RichZR
7 Replies
LEARN ABOUT SUNOS
ssh-add
ssh-add(1) User Commands ssh-add(1)
NAME
ssh-add - add RSA or DSA identities to the authentication agent
SYNOPSIS
ssh-add [-lLdDxX] [-t life] [ file ...]
DESCRIPTION
The ssh-add utility adds RSA or DSA identities to the authentication agent, ssh-agent(1). When run without arguments, it attempts to add
all of the files $HOME/.ssh/identity (RSA v1), $HOME/.ssh/id_rsa (RSA v2), and $HOME/.ssh/id_dsa (DSA v2) that exist. If more than one of
the private keys exists, an attempt to decrypt each with the same passphrase will be made before reprompting for a different passphrase.
The passphrase is read from the user's tty or by running the program defined in SSH_ASKPASS (see below).
The authentication agent must be running.
OPTIONS
The following options are supported:
-d Instead of adding the identity, this option removes the identity from the agent.
-D Deletes all identities from the agent.
-l Lists fingerprints of all identities currently represented by the agent.
-L Lists public key parameters of all identities currently represented by the agent.
-t life Sets a maximum lifetime when adding identities to an agent. The lifetime may be specified in seconds or in a time format specified
in sshd(1M).
-x Locks the agent with a password.
-X Unlocks the agent.
ENVIRONMENT VARIABLES
DISPLAY If ssh-add needs a passphrase, it will read the passphrase from the current terminal if it was run from a terminal. If ssh-
SSH_ASKPASS add does not have a terminal associated with it but DISPLAY and SSH_ASKPASS are set, it will execute the program specified
by SSH_ASKPASS and open an X11 window to read the passphrase. This is particularly useful when calling ssh-add from a
.Xsession or related script.
SSH_AUTH_SOCK Identifies the path of a unix-domain socket used to communicate with the agent.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 An error occurred.
FILES
These files should not be readable by anyone but the user. Notice that ssh-add ignores a file if it is accessible by others. It is possible
to specify a passphrase when generating the key; that passphrase will be used to encrypt the private part of this file.
If these files are stored on a network file system it is assumed that either the protection provided in the file themselves or the trans-
port layer of the network file system provides sufficient protection for the site policy. If this is not the case, then it is recommended
the key files are stored on removable media or locally on the relevant hosts.
Recommended names for the DSA and RSA key files:
$HOME/.ssh/identity Contains the RSA authentication identity of the user for protocol version 1.
$HOME/.ssh/identity.pub Contains the public part of the RSA authentication identity of the user for protocol version 1.
$HOME/.ssh/id_dsa Contains the private DSA authentication identity of the user.
$HOME/.ssh/id_dsa.pub Contains the public part of the DSA authentication identity of the user.
$HOME/.ssh/id_rsa Contains the private RSA authentication identity of the user.
$HOME/.ssh/id_rsa.pub Contains the public part of the RSA authentication identity of the user.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWsshu |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
ssh(1), ssh-agent(1), ssh-keygen(1), sshd(1M), attributes(5)
To view license terms, attribution, and copyright for OpenSSH, the default path is /var/sadm/pkg/SUNWsshdr/install/copyright. If the
Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
location.
AUTHORS
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
Theo de Raadt and Dug Song removed many bugs, added newer features and created Open SSH. Markus Friedl contributed the support for SSH pro-
tocol versions 1.5 and 2.0.
SunOS 5.10 9 Jan 2004 ssh-add(1)