1

I'm installing a fresh openSUSE 13.1 with an autoyast xml file. I can't find the correct way to enable ssh and open the port in the firewall; the "Confirmation" screen shows that SSH service will be disabled, SSH port will be blocked.

I already tried:

<runlevel>
    <services config:type="list">
        <service>
            <service_name>sshd</service_name>
            <service_status>enable</service_status>
        </service>
    </services>
</runlevel>

without success...

1

Just put @mavillian commands systemctl enable sshd and systemctl start sshd In post-scripts section

<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

a) get your current autoyast setup or verify you already have it with

cd /root
mv autoinst.xml autoinst.xml.save
yast2 clone_system

b) assuming the move command above worked you can now do a diff of what autoyast made before (by default), and what you have now.

mv autoinst.xml autoinst.xml.old
yast2 firewall

Now go to "Allowed Services", then goto "Service to Allow" and choose "Secure Shell Server", then "Add", then "Next"

If it is what you want it to be, choose "Finish", otherwise choose "Back"

In your case I believe what you want to see is:

Firewall Starting
 *  Enable firewall automatic starting
 *  Firewall starts after the configuration gets written
 ...
Open Services, Ports, and Protocols
 +  Secure Shell Server           

After Finish, again run yast2 clone_system

Now, to see the differences that you need:

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"/>

So, the key lines are:

<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>
  • Nice, this is a plausible way of doing things. Since I asked this question almost 3 years ago and I am not working with OpenSUSE anymore (ARCH now), I cannot test this and therefore can/will not indicate this as a solution. Thanks anyway! – intrixius Dec 6 '16 at 7:11
  • my pleasure. I am (only recently) working with several distros - sles and opensuse among them, and I was having a terrible time figuring out how to work with autoyast. imho, kickstart is easier to edit -BUT- I would have a much harder time trying to clone a system using kickstart. i.e., each has their strengths and weaknesses. but I would have liked being marked as "solution" :joking: – Michael Felt Dec 7 '16 at 15:56
-2

Since opensuse uses systemd you can try systemctl enable sshd and systemctl start sshd as root or with sudo

  • As this is a headless installation, how can I do this in the autoyast file? And will the firewall also be altered, will the ssh port be opened? – intrixius Jan 31 '14 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.