SSH session without ANY authentication

2019-07-31 14:14发布

I have a special user, called udpate, whose shell is a special command that fetches any pending updates to our system.

I'd like to be able to open an ssh session with this user without any kind of authentication (password or ppk, or anything), so if anyone wants to update a system, they could do "ssh update@<>", without having to know a password, or have a pre-shared public key on the box.

Insecure, I know, but this is over a VPN, so it should not be a problem, and they will only run the update, and then be thrown out.

Can this be done?

2条回答
在下西门庆
2楼-- · 2019-07-31 14:16

VPN is not a good reason to avoid authentification when using ssh. Even if there is a way to do this, you shouldn't use it. Use a ssh-key is the best way to do it. If you really want to do thing like this, use the same key and distribute it on each box.

What did you do if the local network of your box is compromised ? You just have a security hole.

查看更多
Explosion°爆炸
3楼-- · 2019-07-31 14:28

as this rfc points out, there is support for host based authentication https://www.ietf.org/rfc/rfc4252.txt

So using it carefully should be possible by following this tutorial https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Host-based_Authentication#Server_Configuration_for_host-based_authentication.

That may not be a final solution, but helping finding one.

But really, you should not do it for this usecase... Just offer a basic web endpoint which does only start the update process on the next cron run. I know, its not so "simple" but its a lot more secure.

Or if they have access to this server anyway, add a script with super user bit set which triggers the update.

Also, if you have a central server in your company, where everyone has access too, you can use this as step in between to host the key pair, so you dont need to manage X keys for everyone.

Or you use a more modern setup with puppet or anything, or you just configure the server to always update without user interaction needed....

查看更多
登录 后发表回答