You are not logged in.
I am having a very strange issue right now. I have a computer running arch linux that I use as a home server. I usually connect to it via SSH when I need to update things or move files around, but for some reason as of today whenever I type my password into SSH it tells me "Access Denied". I am using Putty as the SSH client. I know 100% for certain that the password is correct, unless someone has hacked my server and changed my password. From what I can tell, though, nothing on the server seems to not be working (my rutorrent client and plex server still seem to be working fine). The last thing I did on it was try to set up NFS (which failed when I realized that windows doesn't have a free NFS client). However I did end up installing the nfs-utils package and libtirpc library. I started up the nfs server but did not enable the service to start on boot with systemd. The problem persists after rebooting.
The reason I am posting here is because the computer has an old graphics card that doesn't have any ports compatible with the monitor I have. Until I can buy a proper converter dongle, I thought I might as well post here and get some feedback.
Last edited by tylerpnn (2016-02-26 02:40:50)
Offline
Yeah, we can't access the server either so there's not much we can tell you beyond what you already know. Obviously installing NFS shouldn't have affected SSH in any way; I would guess it's a coincidence. You really need to get on to the console to be able to view logs.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
whenever I type my password into SSH it tells me "Access Denied".
Unlikely. Is that an exact quote?
What is in the logs on your server?
Edit: Are you certain you are hitting the Arch Linux box, or are you hitting the Windows machine?
Last edited by ewaller (2016-02-24 03:19:56)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
@ tylerpnn In lieu of the video dongle, you might be able to learn something if you could connect your server's HDD to another machine, boot to [live] linux, and view the logs.
@ ewaller "Access denied" seems to be an actual PuTTY error. Also, considering the circumstances accessing the logs seems non-trivial
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
I do use PuTTY and have not seen that error. If it is configured for ssh keys, I suppose that might be possible. If we are talking about a PAM password that exists on the server (as opposed to a ssh key password which could not be compromised by an attack on the Arch server) I would expect to see "Permission denied, please try again" to be issued by the Arch Linux server. If it is a home server, why is access to the logs non-trivial?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Because he apparently can't even access the server locally due to lack of a monitor.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
@ tylerpnn In lieu of the video dongle, you might be able to learn something if you could connect your server's HDD to another machine, boot to [live] linux, and view the logs.
@ ewaller "Access denied" seems to be an actual PuTTY error. Also, considering the circumstances accessing the logs seems non-trivial
Which log am I looking for?
Also another note, the event log in putty says "Password authentication failed" when it prints Access Denied to the console.
EDIT: HOLY SHIT. I looked at the log, and it is unbelievable. Or maybe this happens a lot more often than I thought. The log shows that I my server has been getting login requests from an IP in china for the past 2 weeks.... at a rate of about 1-5 requests per second... I guess I've been brute forced. Lesson learned, ssh keys from now on.
EDIT2: Well now I'm not so sure... the ssh logs also never show anyone else but me actually getting a successful login. And passwd logs do not show the password changing. Still investigating...
EDIT3: So now I've found that no, my password was not changed. My server was being attacked, but none of the attacks have been successful it seems. It turns out that the stuff I did with installing NFS was probably the problem. I'm getting an error with libtirpc, which I installed when trying to get nfs to work. From the log, this is the error every time I try to log in:
Feb 24 02:55:54 arch sshd[557]: PAM unable to dlopen(/usr/lib/security/pam_unix.so): libtirpc.so.1: cannot open shared object file: No such file or directory
Feb 24 02:55:54 arch sshd[557]: PAM adding faulty module: /usr/lib/security/pam_unix.so
Feb 24 02:55:54 arch sshd[557]: PAM unable to dlopen(/usr/lib/security/pam_access.so): libtirpc.so.1: cannot open shared object file: No such file or directory
Feb 24 02:55:54 arch sshd[557]: PAM adding faulty module: /usr/lib/security/pam_access.so
Feb 24 02:55:56 arch sshd[557]: Failed password for ----- from ---.---.---.-- port 50198 ssh2
EDIT4: I tried using the solution on this page: http://archlinuxarm.org/forum/viewtopic.php?f=31&t=9480. I disabled pam for ssh, and now I can ssh into the server! Except now I get an error about a missing module when I try to become root.
~ >> su
su: Module is unknown
~ >> sudo pacman -S pam
sudo: PAM authentication error: Module is unknown
I think pam has become corrupted somehow. I think my only option is to login on the actual console and update PAM (assuming it lets me become root).
Last edited by tylerpnn (2016-02-24 08:41:36)
Offline
I think my only option is to login on the actual console and update PAM
Sigh. Suckered by partial updaters twice in a week. Shame on me.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
EDIT: HOLY SHIT. I looked at the log, and it is unbelievable. Or maybe this happens a lot more often than I thought. The log shows that I my server has been getting login requests from an IP in china for the past 2 weeks.... at a rate of about 1-5 requests per second... I guess I've been brute forced. Lesson learned, ssh keys from now on.
Yeah, that it is about right. ssh keys are a good idea, but if you want to leave the password vector open I suggest:
1. Strong passwords.
2. sshguard, A brute force detector that creates dynamic firewall rules.
3. Enable two factor authentication. I suggest Google Authenticator
I use all three on my system. I still get attacked several times a day, but the attacks last all of about 10 seconds.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
4. Disable root login (PermitRootLogin no)
https://ugjka.net
"It is easier to fool people, than to convince them that they've been fooled" ~ Dr. Andrea Love
Offline
0. Disable root login (PermitRootLogin no)
FTFY -- How could I possibly forget that one.
Last edited by ewaller (2016-02-24 16:40:40)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Alright, finally fixed the problem. Turns out that back in November the PAM authors accidently released a new version that was linked against the wrong version of libtirpc. Because of that, I was somehow allowed to update libtirpc without also updating pam at the same time. Obviously, this caused a ton of issues with PAM.
After I got the adapter to let me use my monitor with my server, I still wasn't able to log in. Even after just entering my user name it would give me an error saying something like "Incorrect User" before even prompting me for my password. Using an arch installation usb I was able to arch-chroot and update pam and all of the problems were gone.
Offline