代码拉取完成,页面将自动刷新
同步操作将从 chuanjiao10/kasini3000_agent_linux 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#
if rpm -q centos-release | grep -Eq 'el6'
then
echo 'not support centos6'
exit 1
fi
if grep -Eq 'Anolis OS 8' /etc/issue || grep -Eq 'Anolis OS 8' /etc/*-release
then
echo 'linux is Anolis OS 8'
if [ -h /usr/bin/pwsh ]
then
echo 'powershell installed Anolis OS 8'
if grep -Eq 'powershell' /etc/ssh/sshd_config
then
echo 'powershell_sshd_good'
exit 0
else
echo '' >> /etc/ssh/sshd_config
echo 'Subsystem powershell /usr/bin/pwsh -sshs -NoLogo -NoProfile' >> /etc/ssh/sshd_config
echo 'UseDNS no' >> /etc/ssh/sshd_config
systemctl restart sshd.service
echo 'powershell_sshd_fixed'
exit 0
fi
else
echo 'installing powershell now'
curl -o /etc/yum.repos.d/microsoft.repo https://packages.microsoft.com/config/rhel/7/prod.repo
yum remove -y powershel
yum install -y powershell
if [ $? -ne 0 ]
then
echo 'install fall'
exit 3
else
echo 'install powershell sucess'
if grep -Eq 'powershell' /etc/ssh/sshd_config
then
echo 'powershell_sshd_good'
exit 0
else
echo '' >> /etc/ssh/sshd_config
echo 'Subsystem powershell /usr/bin/pwsh -sshs -NoLogo -NoProfile' >> /etc/ssh/sshd_config
echo 'UseDNS no' >> /etc/ssh/sshd_config
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
systemctl restart sshd.service
echo 'powershell_sshd_fixed'
exit 0
fi
fi
fi
else
echo 'linux not Anolis OS 8'
exit 2
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。