SSH on Alamlinux still using password

taker18

Verified User
Joined
Oct 18, 2021
Messages
141
Location
USA
Hello
it's my first time using Almalinx, and it shouldn't be different than Ubuntu
But maybe I am doing something wrong, which is most likely. let's see


1- I created a user for the desktop on local and remote server and another different one one for laptop
2- I created directory inside every user on the remote server
mkdir ~/.ssh && chmod 700 ~/.ssh
3- send the public key to remote server scp :
~/.ssh/id_rsa.pub desktop@IP :~/.ssh/authorized_keys
4- Edit the /etc/ssh/sshd_config
Find/edit/add ChallengeResponseAuthentication and set to no:

ChallengeResponseAuthentication no
Next, find PasswordAuthentication set to no too:

PasswordAuthentication no
Search for UsePAM and set to no, too:

UsePAM no
Finally look for PermitRootLogin and set it to no too:
PermitRootLogin no
---> Finally restart SSH with
sudo systemctl restart sshd

After all of this, it used to work with Ubuntu nice and sweet
but I am still able to ssh with the password
for example, I can ssh from anywhere to any user with a password still.
I want to cancel the password login. well, indeed, I am able to cancel the root login but not the password.

any help here
 
I found the Solution: my Solution was adding this command at sudo nano /etc/ssh/sshd_config
Match User mysuer
PasswordAuthentication no
the password is disabled, indeed
 
Yes but only for that user if I'm not mistaken.
Yes, you are correct. That was my issue. I was not able to disable the user password login. now, only SSH with the public key is allowed. I was successful in disabling the root password, no issue; the issue was only with the user.
 
Is that permission correct?
total 100


dr-xr-xr-x. 2 root root 4096 Mar 25 2022 afs


-rw------- 1 root root 8192 Mar 1 17:23 aquota.group


-rw------- 1 root root 7168 Mar 1 17:23 aquota.user


lrwxrwxrwx. 1 root root 7 Mar 25 2022 bin -> usr/bin


dr-xr-xr-x. 5 root root 4096 Feb 22 02:43 boot


drwxr-xr-x 20 root root 3280 Mar 10 04:42 dev


drwxr-xr-x. 94 root root 12288 Mar 11 04:54 etc


drwx--x--x. 6 root root 4096 Mar 11 04:48 home


lrwxrwxrwx. 1 root root 7 Mar 25 2022 lib -> usr/lib


lrwxrwxrwx. 1 root root 9 Mar 25 2022 lib64 -> usr/lib64


drwx------. 2 root root 16384 Jan 8 08:32 lost+found


drwxr-xr-x. 3 root root 4096 Feb 22 04:39 man


drwxr-xr-x. 2 root root 4096 Mar 25 2022 media


drwxr-xr-x. 2 root root 4096 Mar 25 2022 mnt


drwxr-xr-x. 2 root root 4096 Mar 25 2022 opt


dr-xr-xr-x 265 root root 0 Mar 10 04:42 proc


dr-xr-x---. 7 root root 4096 Mar 11 20:14 root


drwxr-xr-x 33 root root 1060 Mar 11 21:58 run


lrwxrwxrwx. 1 root root 8 Mar 25 2022 sbin -> usr/sbin


drwxr-xr-x. 2 root root 4096 Mar 25 2022 srv


dr-xr-xr-x 13 root root 0 Mar 10 04:42 sys


drwxrwxrwt. 15 root root 12288 Mar 11 21:59 tmp


drwxr-xr-x. 12 root root 4096 Jan 8 08:33 usr


drwxr-xr-x. 22 root root 4096 Feb 22 04:29 var
 
Back
Top