I have a SSH + LDAP installation with users public keys stored in LDAP.
I want that when some user in a list (configured into server) do a ssh connection with ssh user@server
always log in as root
. user
user not exists on server, only on LDAP.
Now I have working this steps if I have configured my LDAP uid
as root
and ssh connection is ssh root@server
.
But I need to login with ssh user@server
.
Is SSH able to do this map?
Moved from StackOverflow.
On the SSH server, try adding the following line to bottom of
/etc/passwd
for the ldap user:user:x:0:0::/root:/bin/bash
(replace
user
with the ldap username)This will map the username
user
to root. I know it works if you have a corresponding entry in the shadow file and log in using that type of auth. So hopefully will work without the shadow entry for LDAP.