<p>Hi,</p>
<p>Got a kind of question that seem to have raised a lot, but which seem to have no answer yet according to my Google search.  All solutions so far has been use key pairs or sudo. Both solutions I was aware of but kind of don't help.</p>

<p>Let me explain a bit about why I need the weird sshd setup.  Have bunch of production servers.  Each production server has a UAT. And lots of qa and dev systems too. All are running jboss. </p>
<p>For qa and dev systems,  we use Jenkins for deployment. For UAT and production, we do it manually. I usually run rsync with dry run flag to see what has changed on QA box and then selectively move the files I need to UAT.  The process repeat on prod from UAT.</p>

<p>Now, to make sure I don't miss files remotely, I need to SSH as root. Using any other account risk leaving out some files and having people complain at you when update fails.  So I enabled remote root access and that's how we have been working.</p>

<p>My ideal solution is to disable root access to production, disable root access to UAT other than from production and disable root access to QA other than from UAT boxes.</p>
<p>SSH keys don't work well here. I would have to put the keys all over and that's even more insecure. Sudo only work locally so I don't see how it can be useful.</p>
<p>That left looking at ways to selectifully allowing root access, but from a bit of Googling, it seems either I have missed it or sshd can't be setup this way.</p>
<p>How has people here handled such a situation?</p>
<p>Regards,</p>
<p>William </p>