User login

Troubleshooting ssh connections problem

Micky found this which was key to debugging our connection problem— one way to watch what is happening with the SSH connection attempt is by opening a port just for this use on the server:

sudo /usr/sbin/sshd -d -p 2222

Then from the client:

ssh -vv -p 2222


In this case, the problem was (as suspected) a holdover from an apparently successful change of the user's username with usermod:

sudo usermod -l newusername -m -d /home/newusername oldusername

Every usual place on Debian Linux — the /home directory of course, the /etc/passwd file — had the rename perfectly. Looking at the terminal output on the server while the test connection to port 2222 (instead of 22) took place, we could spot the error:

debug1: Could not open authorized keys '/var/lib/monkeysphere/authorized_keys/newusername': No such file or directory

Our server setup uses monkeysphere. Yours probably doesn't. But for us, moving the oldusername file to the username wasn't enough, we also needed sudo monkeysphere-authentication update-users.

But the important lesson is how to see what the problem is!

Searched words: 
debian user publickey denied after usermod rename Changing the name of a user on the server debian list users on server log ssh key attempts


Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.