{{:serverhp_neofetch.png?400 |}}
----
{{:server_HP_Istituto_Syncthing.png?400 |}}
----
**rc.conf**
root@serverHP:~ # cat /etc/rc.conf
sendmail_enable="NONE"
hostname="serverHP"
keymap="fr.kbd"
#ifconfig_bge0="DHCP"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
zfs_enable="YES"
ifconfig_bge0="inet 10.73.25.154 netmask 255.255.255.0"
defaultrouter="10.73.25.254"
### AGGIUNTI DA ME!
sshd_enable="YES"
ntpd_enable="YES"
firewall_enable="YES"
firewall_script="/etc/ipfw.rules"
cron_enable="YES"
smartd_enable="YES"
samba_server_enable="YES"
----
**ipfw.rules**
root@serverHP:~ # cat /etc/ipfw.rules
IPF="ipfw -q add"
ipfw -q -f flush
#loopback
$IPF 10 allow all from any to any via lo0
$IPF 20 deny all from any to 127.0.0.0/8
$IPF 30 deny all from 127.0.0.0/8 to any
$IPF 40 deny tcp from any to any frag
# statefull
$IPF 50 check-state
$IPF 60 allow tcp from any to any established
$IPF 70 allow all from any to any out keep-state
$IPF 80 allow icmp from any to any
###############
### openSSH ###
###############
$IPF 165 allow tcp from any to any 33 in
$IPF 166 allow tcp from any to any 33 out
# $IPF 167 allow tcp from 62.160.160.194 to any 33 in
# $IPF 168 allow tcp from 62.160.160.194 to any 33 out
##################
### Syncthing ###
##################
# Apro il port di ascolto di Syncthing
$IPF 250 allow all from any to any 22000 in
$IPF 251 allow all from any to any 22000 out
##############
#### Samba ###
##############
$IPF 420 allow all from any to any 81 in
$IPF 421 allow all from any to any 81 out
$IPF 430 allow all from any to any 137 in
$IPF 431 allow all from any to any 137 out
$IPF 440 allow all from any to any 138 in
$IPF 441 allow all from any to any 138 out
$IPF 450 allow all from any to any 139 in
$IPF 451 allow all from any to any 139 out
$IPF 460 allow all from any to any 445 in
$IPF 461 allow all from any to any 445 out
# deny and log everything
$IPF 500 deny log all from any to any
----
**smb4.conf**
root@serverHP:~ # cat /usr/local/etc/smb4.conf
[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = serverHP
wins support = Yes
security = user
passdb backend = tdbsam
# Example: share / accessible only to 'francesco' user
[cinema]
path = /usr/home/francesco/cinema
valid users = francesco, lettore
writable = no
browsable = yes
read only = yes
guest ok = no
public = yes
create mask = 0666
directory mask = 0755
[QuartoDisco]
path = /mnt/QuartoDisco
valid users = francesco
writable = no
browsable = yes
read only = no
guest ok = no
public = yes
create mask = 0666
directory mask = 0755
[Documents]
path = /usr/home/francesco/Documents
valid users = francesco
writable = yes
browsable = yes
read only = no
guest ok = no
public = yes
create mask = 0666
directory mask = 0755
----
**df -hT**
$ df -hT
Filesystem Type Size Used Avail Capacity Mounted on
zroot/ROOT/default zfs 1.2T 5.7G 1.1T 0% /
devfs devfs 1.0K 1.0K 0B 100% /dev
zroot/var/crash zfs 1.1T 117K 1.1T 0% /var/crash
zroot/usr/ports zfs 1.1T 117K 1.1T 0% /usr/ports
zroot/var/mail zfs 1.1T 128K 1.1T 0% /var/mail
zroot/var/audit zfs 1.1T 117K 1.1T 0% /var/audit
zroot/usr/src zfs 1.1T 117K 1.1T 0% /usr/src
zroot/tmp zfs 1.1T 139K 1.1T 0% /tmp
zroot/var/tmp zfs 1.1T 117K 1.1T 0% /var/tmp
zroot zfs 1.1T 117K 1.1T 0% /zroot
zroot/usr/home zfs 5.2T 4.1T 1.1T 78% /usr/home
zroot/var/log zfs 1.1T 1.7M 1.1T 0% /var/log
$
----
**fstab**
root@serverHP:~ # cat /etc/fstab
# Device Mountpoint FStype Options Dump Pass#
/dev/ada0p2 none swap sw 0 0
/dev/ada1p2 none swap sw 0 0
/dev/ada2p2 none swap sw 0 0
#/dev/ada3p1 /mnt/QuartoDisco ufs rw 2 2
----
**gpart**
root@serverHP:~ # gpart list
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 5860533127
first: 40
entries: 128
scheme: GPT
Providers:
1. Name: ada0p1
Mediasize: 524288 (512K)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r0w0e0
efimedia: HD(1,GPT,f285fdf7-5013-11e9-9f95-3cd92b0c2005,0x28,0x400)
rawuuid: f285fdf7-5013-11e9-9f95-3cd92b0c2005
rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
label: gptboot0
length: 524288
offset: 20480
type: freebsd-boot
index: 1
end: 1063
start: 40
2. Name: ada0p2
Mediasize: 2147483648 (2.0G)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e0
efimedia: HD(2,GPT,f2a6e92b-5013-11e9-9f95-3cd92b0c2005,0x800,0x400000)
rawuuid: f2a6e92b-5013-11e9-9f95-3cd92b0c2005
rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
label: swap0
length: 2147483648
offset: 1048576
type: freebsd-swap
index: 2
end: 4196351
start: 2048
3. Name: ada0p3
Mediasize: 2998443966464 (2.7T)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e1
efimedia: HD(3,GPT,f2c01a3a-5013-11e9-9f95-3cd92b0c2005,0x400800,0x15d109800)
rawuuid: f2c01a3a-5013-11e9-9f95-3cd92b0c2005
rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
label: zfs0
length: 2998443966464
offset: 2148532224
type: freebsd-zfs
index: 3
end: 5860532223
start: 4196352
Consumers:
1. Name: ada0
Mediasize: 3000592982016 (2.7T)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r2w2e3
Geom name: ada1
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 5860533127
first: 40
entries: 128
scheme: GPT
Providers:
1. Name: ada1p1
Mediasize: 524288 (512K)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r0w0e0
efimedia: HD(1,GPT,f30a09c6-5013-11e9-9f95-3cd92b0c2005,0x28,0x400)
rawuuid: f30a09c6-5013-11e9-9f95-3cd92b0c2005
rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
label: gptboot1
length: 524288
offset: 20480
type: freebsd-boot
index: 1
end: 1063
start: 40
2. Name: ada1p2
Mediasize: 2147483648 (2.0G)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e0
efimedia: HD(2,GPT,f32aedc7-5013-11e9-9f95-3cd92b0c2005,0x800,0x400000)
rawuuid: f32aedc7-5013-11e9-9f95-3cd92b0c2005
rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
label: swap1
length: 2147483648
offset: 1048576
type: freebsd-swap
index: 2
end: 4196351
start: 2048
3. Name: ada1p3
Mediasize: 2998443966464 (2.7T)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e1
efimedia: HD(3,GPT,f344cde6-5013-11e9-9f95-3cd92b0c2005,0x400800,0x15d109800)
rawuuid: f344cde6-5013-11e9-9f95-3cd92b0c2005
rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
label: zfs1
length: 2998443966464
offset: 2148532224
type: freebsd-zfs
index: 3
end: 5860532223
start: 4196352
Consumers:
1. Name: ada1
Mediasize: 3000592982016 (2.7T)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r2w2e3
Geom name: ada2
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 5860533127
first: 40
entries: 128
scheme: GPT
Providers:
1. Name: ada2p1
Mediasize: 524288 (512K)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r0w0e0
efimedia: HD(1,GPT,f38d6de3-5013-11e9-9f95-3cd92b0c2005,0x28,0x400)
rawuuid: f38d6de3-5013-11e9-9f95-3cd92b0c2005
rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
label: gptboot2
length: 524288
offset: 20480
type: freebsd-boot
index: 1
end: 1063
start: 40
2. Name: ada2p2
Mediasize: 2147483648 (2.0G)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e0
efimedia: HD(2,GPT,f3b18085-5013-11e9-9f95-3cd92b0c2005,0x800,0x400000)
rawuuid: f3b18085-5013-11e9-9f95-3cd92b0c2005
rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
label: swap2
length: 2147483648
offset: 1048576
type: freebsd-swap
index: 2
end: 4196351
start: 2048
3. Name: ada2p3
Mediasize: 2998443966464 (2.7T)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e1
efimedia: HD(3,GPT,f3cd16e7-5013-11e9-9f95-3cd92b0c2005,0x400800,0x15d109800)
rawuuid: f3cd16e7-5013-11e9-9f95-3cd92b0c2005
rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
label: zfs2
length: 2998443966464
offset: 2148532224
type: freebsd-zfs
index: 3
end: 5860532223
start: 4196352
Consumers:
1. Name: ada2
Mediasize: 3000592982016 (2.7T)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r2w2e3