ssh: Permission denied, please try again. #1 14 Hours Ago
Hello guys:

I am trying to ssh from box1 to box2. The user is user1 and IPbox2 is the IP of box2 (not the real thing though, but you get the idea). This is the command I am using from the command line:

box1#ssh -l user1 IPbox2
user1@IPbox2's password:

After entering the password, this is what I get back:
Permission denied, please try again.

Is there anyone out there who can help me solve this problem?
Thanks.
--Willie

Dani AI

Generated

Good call by and nice follow‑up by — the fact that you could reach box2 as root after becoming root on box1 shows the network and sshd were reachable. That narrows the cause to something specific to the user1 account or authentication method (wrong password, account locked/expired, invalid shell, or different key setup for root).

Quick diagnostic checklist (run the client line first so you capture the SSH debug, then examine the remote host as needed):

# see what auth methods ssh tries
ssh -vvv user1@IPbox2

# confirm the account exists and UID/GID
getent passwd user1
id user1

# check password/lock/expiry status
sudo passwd -S user1
sudo chage -l user1

# look for precise failure messages in the server logs
sudo tail -n 200 /var/log/auth.log    # Debian/Ubuntu
sudo tail -n 200 /var/log/secure      # RHEL/CentOS

# inspect sshd policies that affect who can log in
sudo grep -E "PasswordAuthentication|PubkeyAuthentication|PermitRootLogin|AllowUsers|DenyUsers" /etc/ssh/sshd_config

Common fixes

  • If user1 is missing or has shell=/sbin/nologin, recreate/fix the account or change the shell.
  • If the account is locked/expired reset/unlock it (passwd, chage).
  • If root worked because of an SSH key in /root/.ssh, give user1 a key (generate with ssh-keygen and copy with ssh-copy-id) and ensure ~/.ssh is 700 and authorized_keys is 600.
  • If you change sshd settings, keep an open session while testing the new connection before closing your working root session.

Security note: avoid leaving password root login enabled long term. Prefer per-user keys + sudo for privilege escalation, and use PermitRootLogin no once users are configured.

Recommended Answers

All 3 Replies

Try it like this:

ssh root@1.2.3.4.5

Hello techniner:

Unfortunately, I cannot try it because I do not
have the root password for the server. Do you think that becoming sudo and then trying it would do it. Well, before you answer, let me try it.

I will be back.
Thanks.
--Willie

Hello techniner:

If you are not a genius, then who is it?
I am able to ssh to box2.
I became sudo first:

sudo su -
Password:
[root@box1 ~]#ssh root@IPbox2
Last login: Wed Jan 18 15:15:05 2008 from box1
[root@box2 ~]#

Thanks for your help in finding this solution.
--Willie

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.