D
D
DVoropaev2019-08-03 18:43:17
linux
DVoropaev, 2019-08-03 18:43:17

How to set a password for ssh other than local?

I want to use one password to log in from the computer itself, and remotely (using the same user) use a more complex password.
I don't want to create a separate user for this

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Saboteur, 2019-08-03
@DVoropaev

1. You can tweak it on your knee by creating two users with the same UID / GID
, edit /etc/passwd

testuser:x:1003:1003:,,,:/home/testuser:/bin/bash
testuser1:x:1003:1003:,,,:/home/testuser:/bin/bash

We make passwords different, everything else is the same.
When both users log in, Linux will everywhere display the name of only the first one (testuser), since the UID matches, the HOME matches, everything matches.
Then we forbid remote login to one of the users:
In /etc/ssh/sshd_config We
overload sshd and that's it.
2. You can stir up almost the same thing by adding ldap authorization to pam_unix, configure ldap, and add a second user to LDAP (also register the same UID / GID).
3. It is best of course to set up a complex password and ssh keys, and not take a steam bath.

T
tutuborg, 2019-08-03
@tutuborg

No way.
Or create a user.
Or connect remotely not with a password, but with a key (+ a password for the key if desired).

P
pfg21, 2019-08-03
@pfg21

do not be smart and prohibit access by password remotely.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question