I am usng ubuntu 10.04
I have installed on both computers
sudo apt-get install ssh

I have the problem I want to connect from comp1 to comp2.
I crate my rsa.

comp1@laptop$ ssh-keygen -b1024 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/comp1/.ssh/id_rsa):

Enter passphrase (empty for no passphrase): testingtesting
Enter same passphrase again: testingtesting
Your identification has been saved in /home/comp1/.ssh/id_rsa.
Your public key has been saved in /home/comp1/.ssh/id_rsa.pub.
The key fingerprint is:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx comp1@laptop
The key's randomart image is:

I have root pass for comp2 as 2xx3xx
I have root pass for comp1 as 3xx2xx

comp1@laptop -l user1@ipno
user1@ipno's password: 2xx3xx
Permission denied, please try again.
comp1@laptop's password: testingtesting
Permission denied, please try again.
comp1@laptop's password: 3xx2xx

So i do as follow a sugestion that said use root.

It gave the same answer

root@laptop -l user1@ipno
root@ipno's password: 2xx3xx
Permission denied, please try again.
root@ipno's password: testingtesting
Permission denied, please try again.
root@ipno's password: 3xx2xx

Please help, please help

Dani AI

Generated

Likely causes: the key’s passphrase is being confused with the remote account password; the public key was never installed for the correct account; or SSH on the server is rejecting key logins because of wrong permissions or server config. was right that the account password (not root’s) is used when authenticating the account, and root logins are often disabled. ’s workflow of putting the public key into the target account’s authorized_keys is correct, but ownership and file modes must be exact.

Fast, reliable workflow (avoids manual copy errors):

ssh-copy-id user1@host
ssh -v user1@host
# on the server, ensure strict permissions:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chown -R user1:user1 ~/.ssh

Notes: the passphrase chosen during key generation only unlocks the private key locally. Entering that passphrase at the remote password prompt will not authenticate the remote account. If the private key has a passphrase, it will be requested locally (or can be cached with an agent).

Server-side checks and common failure messages: inspect /etc/ssh/sshd_config for PermitRootLogin, PubkeyAuthentication and AuthorizedKeysFile settings, then restart the SSH daemon (for Ubuntu: sudo service ssh restart). Watch the server log while attempting login (sudo tail -f /var/log/auth.log) — typical server hints include “bad ownership or modes” for the .ssh directory or “server refused our key”. Also confirm the public key in authorized_keys is a single, unbroken line and owned by the target user.

If key auth still fails, run the SSH client with verbose flags (ssh -vvv user1@host) to see which keys are offered and why they were rejected. The combination of correct target account, correct placement of the public key, strict permissions, and examining both client and server logs resolves the vast majority of permission-denied problems.

Recommended Answers

All 2 Replies

You should be using the account password for user1, not the root password.

As for connecting as root noramlly ssh is configured to reject root logins via ssh.

On my systems, I have do the following:
ssh-keygen -t dsa
The utility asks for the filename in which to save the key. I entered the following:
/root/.ssh/dev32_id_dsa (dev32 is the hostname)
I entered an empty passphrase, twice.
accepted the default of /root/.ssh/id_dsa.
In this directory, I have four files. authorized_keys, id_rsa, id_rsa.pub, and known_hosts.

Normally, I copy the id_rsa.pub file from computer#1 to /home/terryk/.ssh/ like this:
scp id_rsa.pub computer#2:/home/terryk/.ssh/id_rsa.pub.computer1
Then I add it to the authorized_keys files like this:
cat id_rsa.pub.computer1 >> authorized_keys (if the authorized_keys file does not exist, then)
cat id_rsa.pub.computer1 > authorized_keys

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.