Posts

Showing posts from August 21, 2011

Connecting to remote host with ssh without password - By passing ssh/scp password

go to the node from where you will be connecting [ source machine ] run ssh-keygen -t dsa or ssh-keygen -t rsa this will generate public and private key when asked for file name and password just press enter so that default file will be created and password will be blank now copy the .pub content to the target machine's authorized_keys file under [username]/.ssh/ ssh-copy-id  -i [pub_file_name] [username]@[targethostname] [it will ask for password to connect to target provide password for this time] ex: ssh-copy-id  -i id_dsa.pub testuser@testserver this command will copy the public key to the target machines user's authorised_keys file location of the authorized_key file is - [user's home folder]/.ssh/ if the above command does not work copy the public key manually to target machine add the copied public key to user's authorized_key file, if it does not exist just create one ex: ssh-copy-id -i id_dsa.pub test@testserver Note: ssh-copy-id comm