SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I need help with my firewall settings, and I prospected using the script option.
#!/bin/bash
#
# This script is executed whenever your appliance boots. Here you can add
# commands to be executed before the system enters the first runlevel. This
# could include loading kernel modules, starting daemons that aren't managed
# by init files, asking questions at the console, etc.
#
# The 'kiwi_type' variable will contain the format of the appliance (oem =
# disk image, vmx = VMware, iso = CD/DVD, xen = Xen).
#
# read in some variables
. /studio/profile
if [ -f /etc/init.d/suse_studio_firstboot ]
then
echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi
As you can see I need to use the terminal commands of "iptables -I INPUT -p tcp --dport 113 -j DROP" and "iptables -I INPUT -p icmp -j DROP." Is there anything wrong with my script or should I even be using script in the first place?
#!/bin/bash
#
# This script is executed whenever your appliance boots. Here you can add
# commands to be executed before the system enters the first runlevel. This
# could include loading kernel modules, starting daemons that aren't managed
# by init files, asking questions at the console, etc.
#
# The 'kiwi_type' variable will contain the format of the appliance (oem =
# disk image, vmx = VMware, iso = CD/DVD, xen = Xen).
#
# read in some variables
. /studio/profile
if [ -f /etc/init.d/suse_studio_firstboot ]
then
echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi
That's a bit difficult to read: using code tags helps
Code:
#!/bin/bash
#
# This script is executed whenever your appliance boots. Here you can add
# commands to be executed before the system enters the first runlevel. This
# could include loading kernel modules, starting daemons that aren't managed
# by init files, asking questions at the console, etc.
#
# The 'kiwi_type' variable will contain the format of the appliance (oem =
# disk image, vmx = VMware, iso = CD/DVD, xen = Xen).
#
# read in some variables
. /studio/profile
if [ -f /etc/init.d/suse_studio_firstboot ]
then
echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi
is rather easier.
Quote:
Originally Posted by Tactful
Hi, I need help with my firewall settings, and I prospected using the script option.
if [ -f /etc/init.d/suse_studio_firstboot ]
then
echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi
I never really like using -I for iptables; it would only take a change to what went on previously for the end result to be rather different. However, having said that, have you tried listing your iptables ruleset to check that the end result is what you expected? Presumably, you did check that /etc/init.d/suse_studio_firstboot exists?
Quote:
Originally Posted by Tactful
if [ -f /etc/init.d/suse_studio_firstboot ]
then
echo "Running SUSE Studio first boot script..."
iptables -I INPUT -p tcp --dport 113 -j DROP
iptables -I INPUT -p icmp -j DROP
fi
As you can see I need to use the terminal commands of "iptables -I INPUT -p tcp --dport 113 -j DROP" and "iptables -I INPUT -p icmp -j DROP." Is there anything wrong with my script or should I even be using script in the first place?
Terminal commands? bash commands, really (there are shells other than bash). I can't see what other options there are other than a script, but maybe there is some other way of setting stuff up in Studio - there is in plain openSUSE (Yast), but I'm not sure about Studio.
By the way, in earlier versions of Suse, 'going behind Yast's back' was a recipe for confusion, as Yast had a habit of thinking that it knew best, and overwriting your changes. Oh, and Suse starts up its firewall in two stages, and if you make your changes while 'early' (whatever the first part is called) is in place, they'll get overwritten when 'final' is put in place.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.