SSH session without ANY authentication

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 08:09:16

问题


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?


回答1:


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.




回答2:


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....



来源:https://stackoverflow.com/questions/24673155/ssh-session-without-any-authentication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!