My work has set up an Ubuntu server for my team to host a project on. They set up a sudo user for me with my name as the username, and a default password. I was able to SSH into the server using these original username and password.

Since my whole team would be accessing the server, I wanted to change the username and password so that it wasn't my name, but instead the project name. After doing so, I think I was still able to SSH in using the new username and password. However, now when I try to SSH in I get the error ssh: connect to host xxx.xx.xx.xx port 22: Connection refused.

The server was set up so that it can only be accessed from any of our office's networks. Is this sudden refused connection due to me changing the username and password (maybe something to do with the RSA keys, I don't know), or else is it more likely to be an issue with firewalls or my office's network?


Here is a detailed description of the process I took to change the username from 'abc' to 'xyz':

  1. While logged in as user 'abc', I tried to run sudo usermod -l xyz abc, but I couldn't as it said process abc is already running.
  2. I then created a new user named 'temp' with sudo access.
  3. I SSHd in as 'temp', ran sudo usermod -l xyz abc without any errors.
  4. I then SSHd in with 'xyz' successfully, deleted user 'temp' and ran passwd to change xyz's password.
  5. I'm pretty sure I exited from SSH, then successfully SSHd in again with the new username and password, but I may be wrong here - I can't remember.

closed as off-topic by DarkHeart, mosvy, Shadur, muru, Jeff Schaller Apr 21 at 15:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DarkHeart, mosvy, Shadur, muru, Jeff Schaller
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Connection refused is not the error you usually get when username and/or password are not recognized/allowed to connect. You may want to search the verbose output of ssh -v (or -vv or -vvv for extra verbosity) for useful debugging messages. – fra-san Apr 17 at 10:26
  • I concur with @fra-san -- you're almost certainly barking up the wrong tree. – Shadur Apr 18 at 7:18

It was confirmed by the IT team that it is a problem with our network and just coincidentally happened after I changed the username and password.

Changing the username and password shouldn't effect the ability to still SSH in using these new details.


The connection refused error indicates that the IP you're trying to ssh, is refusing the connection. In case of incorrect password it will give an authentication error. Are you able to get to the password prompt?

Not the answer you're looking for? Browse other questions tagged or ask your own question.