SSH - PasswordLess

tienloc1
Posts: 27
Joined: Sun Aug 08, 2021 9:58 pm

Hi,

I have an issue and I'm not sure if it's a restriction or not. I can create passwordless for any user but not the admin. Is it a restriction?
User avatar
isscbta
Team Member
Posts: 130
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 15 times
Been thanked: 3 times

You can't create another admin account with no password, because there is already one created through the myVesta installation. And that account has to have a password to be able to login into that account.

As for other users, they also must have some password because that field is mandatory
tienloc1
Posts: 27
Joined: Sun Aug 08, 2021 9:58 pm

isscbta wrote: Wed Aug 24, 2022 7:15 pm You can't create another admin account with no password, because there is already one created through the myVesta installation. And that account has to have a password to be able to login into that account.

As for other users, they also must have some password because that field is mandatory
No, I need to login/exist many times when working with cmd, wp cli. So I've added the id_rsa.pub to my /.ssh/authorized_keys, but it's impossible for the default admin created through the myVesta installation.

The other accounts working fine and even the root account can log-in without adding the password, but the admin user isn't working and I'm not sure why.

Image
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

check if admin has /bin/bash in /etc/passwd
tienloc1
Posts: 27
Joined: Sun Aug 08, 2021 9:58 pm

myVesta wrote: Wed Aug 24, 2022 7:46 pm check if admin has /bin/bash in /etc/passwd
I checked and seems it's correctly for me.
admin: x : 1000 : 1000:[email protected]:/home/admin:/bin/bash
*Need to add space to avoid the error, but no space in the passwd file.
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

give me output of

Code: Select all

tail /etc/ssh/sshd_config
tienloc1
Posts: 27
Joined: Sun Aug 08, 2021 9:58 pm

The result below:

Code: Select all

# override default of no subsystems
Subsystem       sftp    /usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       PermitTTY no
#       ForceCommand cvs server
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

I have no idea why you can't SSH to admin account...
Maybe /var/log/auth.log can clarify what is going on.
tienloc1
Posts: 27
Joined: Sun Aug 08, 2021 9:58 pm

myVesta wrote: Thu Aug 25, 2022 9:35 am I have no idea why you can't SSH to admin account...
Maybe /var/log/auth.log can clarify what is going on.
I can ssh to the admin account but I don't want to add password every time when ssh (no password with SSH KEY).

My auth.log is here: https://tienloc.notion.site/auth-log-6d ... 6333c60ad9.
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

Sorry, I can't read the whole log file.
Can you cut and paste here only the moment when it denied your SSH connection?
Post Reply