首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用autoyast启用ssh

使用autoyast启用ssh
EN

Unix & Linux用户
提问于 2014-01-30 14:21:54
回答 3查看 2.2K关注 0票数 1

我正在安装一个带有autoyast文件的新的openSUSE 13.1。我找不到正确的方法来启用ssh并在防火墙中打开端口;“确认”屏幕显示SSH service will be disabled, SSH port will be blocked

我已经试过了

代码语言:javascript
复制
<runlevel>
    <services config:type="list">
        <service>
            <service_name>sshd</service_name>
            <service_status>enable</service_status>
        </service>
    </services>
</runlevel>

没有成功..。

EN

回答 3

Unix & Linux用户

发布于 2016-03-03 13:23:56

只需将@mavillian命令systemctl enable sshdsystemctl start sshd放在后脚本部分即可

代码语言:javascript
复制
<scripts>

    <post-scripts config:type="list">
      <script>
        <filename>setupssh.sh</filename>
        <interpreter>shell</interpreter>
        <debug config:type="boolean">true</debug>
        <source><![CDATA[
            systemctl enable sshd.service
            systemctl start sshd.service
        ]]></source>
      </script>
    </post-scripts>
  </scripts>
票数 1
EN

Unix & Linux用户

发布于 2016-12-05 19:59:41

( a)获取当前的自动安装程序,或验证您已经使用了

代码语言:javascript
复制
cd /root
mv autoinst.xml autoinst.xml.save
yast2 clone_system

( b)假设上面的move命令有效,现在您可以对autoyast以前所做的操作(默认情况下)和现在的内容进行区分。

代码语言:javascript
复制
mv autoinst.xml autoinst.xml.old
yast2 firewall

现在转到“允许的服务”,然后转到“服务允许”,然后选择“安全Shell服务器”,然后“添加”,然后选择“下一步”

如果这是你想要的,选择“完成”,否则选择“返回”。

在你的例子中我相信你想看到的是:

代码语言:javascript
复制
Firewall Starting
 *  Enable firewall automatic starting
 *  Firewall starts after the configuration gets written
 ...
Open Services, Ports, and Protocols
 +  Secure Shell Server           

Finish之后,再次运行yast2 clone_system

现在,要了解您需要的不同之处:

代码语言:javascript
复制
cp autoinst.xml autoinst.sshd.xml
diff -u autoinst.xml.old autoinst.sshd.xml

x070:~ # diff -u  autoinst.xml.old autoinst.sshd.xml
--- autoinst.xml.old    2016-12-05 20:51:00.000000000 +0100
+++ autoinst.sshd.xml   2016-12-05 20:54:38.000000000 +0100
@@ -52,7 +52,7 @@
     <FW_ALLOW_FW_BROADCAST_EXT>no</FW_ALLOW_FW_BROADCAST_EXT>
     <FW_ALLOW_FW_BROADCAST_INT>no</FW_ALLOW_FW_BROADCAST_INT>
     <FW_CONFIGURATIONS_DMZ></FW_CONFIGURATIONS_DMZ>
-    <FW_CONFIGURATIONS_EXT></FW_CONFIGURATIONS_EXT>
+    <FW_CONFIGURATIONS_EXT>sshd</FW_CONFIGURATIONS_EXT>
     <FW_CONFIGURATIONS_INT></FW_CONFIGURATIONS_INT>
     <FW_DEV_DMZ></FW_DEV_DMZ>
     <FW_DEV_EXT>any eth0</FW_DEV_EXT>
@@ -89,8 +89,8 @@
     <FW_SERVICES_INT_RPC></FW_SERVICES_INT_RPC>
     <FW_SERVICES_INT_TCP></FW_SERVICES_INT_TCP>
     <FW_SERVICES_INT_UDP></FW_SERVICES_INT_UDP>
-    <enable_firewall config:type="boolean">false</enable_firewall>
-    <start_firewall config:type="boolean">false</start_firewall>
+    <enable_firewall config:type="boolean">true</enable_firewall>
+    <start_firewall config:type="boolean">true</start_firewall>
   </firewall>
   <general>
     <ask-list config:type="list"/>

因此,重点是:

代码语言:javascript
复制
<firewall>
    <enable_firewall config:type="boolean">true</enable_firewall>
    <start_firewall config:type="boolean">true</start_firewall>
    <FW_CONFIGURATIONS_EXT>sshd</FW_CONFIGURATIONS_EXT>
</firewall>
票数 1
EN

Unix & Linux用户

发布于 2014-01-30 18:46:07

由于opensuse使用systemd,所以您可以尝试使用systemctl enable sshdsystemctl start sshd作为root或使用sudo。

票数 -2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/111675

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档