Install TeamViewer 10 on Peppermint OS 5

My new laptop has arrived. Its a HP Pavilion Laptop Computer Silver plus 4GB more memory. I choose it over my old laptop that powered by Acer due its processor. 332 bit limitation force me to walk in place. Maximum 4GB memory limitation and unable to test server software that available in 64 bit. Lucky me that I still able to use cheap cloud provider that cost me $5/month that allow me to install many operating system as many as I want. Very helpful in many case but I still have problem when I have to show a demo server where no internet connection available.

I install Peppermint OS 5 for my new laptop. I choose it simply for the name and since this distro use Lubuntu that more familiar for me.

Installation is very smooth and my wife even like it. She want me to install it for her netbook (I’m in process download iso for 32 bit architecture).

During this holiday season a call is coming and I need to see client monitor. The answer is teamviewer and I decide to use latest version (teamviewer 10).

Here the steps for install teamviewer 10 on peppermint os 5 :

1. Download 64 bit version from here

$ wget -c http://download.teamviewer.com/download/teamviewer_amd64.deb

2. Install it from command line

Yes, if you use gui you’ll get this error screen

teamviewer10_peppermint errror when you choose 64 bit

Yes. lib32asound2 needed for installation. In fact I can’t find it in repository.

$ sudo dpkg -i teamviewer_10.0.36281_amd64.deb

[sudo] password for alamsyah:
Selecting previously unselected package teamviewer.
(Reading database … 186532 files and directories currently installed.)
Preparing to unpack teamviewer_10.0.36281_amd64.deb …
Unpacking teamviewer (10.0.36281) …
dpkg: dependency problems prevent configuration of teamviewer:
teamviewer depends on lib32asound2; however:
Package lib32asound2 is not installed.
teamviewer depends on ia32-libs; however:
Package ia32-libs is not installed.

dpkg: error processing package teamviewer (–install):
dependency problems – leaving unconfigured
Errors were encountered while processing:
teamviewer.

Check it

$ sudo dpkg --get-selections | grep teamviewer
teamviewer install

Yes, its installed.

Fix anything related.

$ sudo apt-get install -f
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following packages were automatically installed and are no longer required:
lib32z1 libc6-i386
Use ‘apt-get autoremove’ to remove them.
The following packages will be REMOVED:
teamviewer
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 120 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

Well. Looks like 64bit is not welcome at the moment.

I need 32/64 bit multi architecture.

$ wget -c http://download.teamviewer.com/download/teamviewer_i386.deb

Uninstall ‘half baked’ teamviewer I install previously.

$ sudo apt-get install -f
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following packages were automatically installed and are no longer required:
lib32z1 libc6-i386
Use ‘apt-get autoremove’ to remove them.
The following packages will be REMOVED:
teamviewer
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 120 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 186778 files and directories currently installed.)
Removing teamviewer (10.0.36281) …

Back to install

$ sudo dpkg --add-architecture i386

$ sudo dpkg -i teamviewer_i386.deb
Selecting previously unselected package teamviewer.
(Reading database … 186532 files and directories currently installed.)
Preparing to unpack teamviewer_i386.deb …
Unpacking teamviewer (10.0.36281) …
dpkg: dependency problems prevent configuration of teamviewer:
teamviewer depends on libjpeg62.
teamviewer depends on libxtst6.

dpkg: error processing package teamviewer (–install):
dependency problems – leaving unconfigured
Errors were encountered while processing:
teamviewer

Ups, another dependency problem.

Let apt-get fix it.

$ sudo apt-get install -f
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following packages were automatically installed and are no longer required:
lib32z1 libc6-i386
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
libjpeg62:i386 libxtst6:i386
The following NEW packages will be installed:
libjpeg62:i386 libxtst6:i386
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 89,7 kB of archives.
After this operation, 266 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

Get:1 http://id.archive.ubuntu.com/ubuntu/ trusty/main libjpeg62 i386 6b1-4ubuntu1 [75,8 kB]
Get:2 http://id.archive.ubuntu.com/ubuntu/ trusty/main libxtst6 i386 2:1.2.2-1 [13,8 kB]
Fetched 89,7 kB in 3s (29,1 kB/s)
Selecting previously unselected package libjpeg62:i386.
(Reading database … 186778 files and directories currently installed.)
Preparing to unpack …/libjpeg62_6b1-4ubuntu1_i386.deb …
Unpacking libjpeg62:i386 (6b1-4ubuntu1) …
Selecting previously unselected package libxtst6:i386.
Preparing to unpack …/libxtst6_2%3a1.2.2-1_i386.deb …
Unpacking libxtst6:i386 (2:1.2.2-1) …
Setting up libjpeg62:i386 (6b1-4ubuntu1) …
Setting up libxtst6:i386 (2:1.2.2-1) …
Setting up teamviewer (10.0.36281) …
Processing triggers for libc-bin (2.19-0ubuntu6.4) …

Try again

$ sudo dpkg -i teamviewer_i386.deb
(Reading database … 186787 files and directories currently installed.)
Preparing to unpack teamviewer_i386.deb …
Unpacking teamviewer (10.0.36281) over (10.0.36281) …
Setting up teamviewer (10.0.36281) …

Looks fine.

Access it from Menu -> Internet -> Team Viewer 10

teamviewer10 installed successfully on pepermintos 5 64 bit

Conclusion for Teamviewer 10 on Peppermint OS 5 64 bit is : use 32bit or you’ll get nothing :-)

Happy new year 2015 everyone.

Quick dns server for CentOS 7 minimal

Damn, this CentOS 7 minimal installation has taken my whole day. The last thing I want to try is dns server. Since I’ve working standard dns that use maradns under CentOS 5.10 then I’m going to try the steps here. Using CentOS 7.

# yum install gcc wget

# gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure –prefix=/usr –mandir=/usr/share/man –infodir=/usr/share/info –with-bugurl=http://bugzilla.redhat.com/bugzilla –enable-bootstrap –enable-shared –enable-threads=posix –enable-checking=release –with-system-zlib –enable-__cxa_atexit –disable-libunwind-exceptions –enable-gnu-unique-object –enable-linker-build-id –with-linker-hash-style=gnu –enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto –enable-plugin –enable-initfini-array –disable-libgcj –with-isl=/builddir/build/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/isl-install –with-cloog=/builddir/build/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/cloog-install –enable-gnu-indirect-function –with-tune=generic –with-arch_32=x86-64 –build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC)

Download latest MaraDNS Source Code

# wget -c http://maradns.samiam.org/download/2.0/2.0.09/maradns-2.0.09.tar.bz2

# tar xvjf maradns-2.0.09.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Ups CentOS 7 minimal install not install bzip2

# yum install bzip2

Re extract

# tar xvjf maradns-2.0.09.tar.bz2

# cd maradns-2.0.09

# make

# make install

VERSION=2.0.09 ./build/install.sh
Installing MaraDNS, placing programs in /usr/local//bin/ and /usr/local//sbin/,
man pages in /usr/local//share/man/man1, /usr/local//share/man/man5,
and /usr/local//share/man/man8, and documents in /usr/local//doc/maradns-2.0.09
Adding MaraDNS startup scripts
Starting up MaraDNS at runlevel 3
starting up MaraDNS at runlevel 5

Start MaraDNS

# service maradns start
Starting all maradns processes
Starting maradns process which uses Mararc file /etc/mararc

Check it

# ps ax | grep mara
19635 pts/0    S      0:00 /usr/local/bin/duende /usr/local/sbin/maradns -f /etc/mararc
19636 pts/0    S      0:00 /usr/local/sbin/maradns -f /etc/mararc
19637 pts/0    S      0:00 /usr/local/bin/duende /usr/local/sbin/maradns -f /etc/mararc

# nano /etc/mararc

looking for ipv4_bind_address line and change it into :

ipv4_bind_addresses = “192.168.1.88, 127.0.0.1”

My lan ip address is 192.168.1.88

# chkconfig maradns on

Edit test dns zone file

# nano /etc/maradns/db.example.net

test.example.net.      +14400    soa    ns1.example.net. dns@example.net. 2012010117 14400 3600 604800 14400 ~
example.net.      +14400    ns     ns1.example.net. ~
example.net.      +14400    ns     ns2.example.net. ~
ns1.example.net.  +14400    a       192.168.1.88 ~
ns2.example.net.  +14400    a       192.168.1.88 ~
example.net.      +14400    a       127.0.0.1 ~
www.example.net.  +14400    a       127.0.0.1 ~
example.net.      +14400    mx     10 mail.example.net. ~
test.example.net. +14400    a       192.168.1.88 ~

save the file.

Restart maradns service

# service maradns restart

Sending all MaraDNS processes the TERM signal
waiting 1 second
Sending all MaraDNS processes the KILL signal
MaraDNS should have been stopped
Starting all maradns processes
Starting maradns process which uses Mararc file /etc/mararc

Testing using dig

# yum install bind-utils

# dig @192.168.1.88 test.example.net

; <<>> DiG 9.9.4-RedHat-9.9.4-14.el7 <<>> @192.168.1.88 test.example.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10783
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;test.example.net.        IN    A

;; ANSWER SECTION:
test.example.net.    14400    IN    A    192.168.1.88

;; AUTHORITY SECTION:
example.net.        14400    IN    NS    ns1.example.net.
example.net.        14400    IN    NS    ns2.example.net.

;; ADDITIONAL SECTION:
ns1.example.net.    14400    IN    A    192.168.1.88
ns2.example.net.    14400    IN    A    192.168.1.88

;; Query time: 0 msec
;; SERVER: 192.168.1.88#53(192.168.1.88)
;; WHEN: Kam Des 11 15:04:23 WIB 2014
;; MSG SIZE  rcvd: 118

Testing from other user in local area network

$ dig @192.168.1.88 test.example.net

; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> @192.168.1.88 test.example.net
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

Seem firewall block udp connection and port 53.

# firewall-cmd --permanent --add-port=53/udp

# systemctl restart firewalld.service

# service maradns restart

Re test resolver from LAN

$ dig @192.168.1.88 test.example.net

; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> @192.168.1.88 test.example.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4614
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;test.example.net.        IN    A

;; ANSWER SECTION:
test.example.net.    14400    IN    A    192.168.1.88

;; AUTHORITY SECTION:
example.net.        14400    IN    NS    ns1.example.net.
example.net.        14400    IN    NS    ns2.example.net.

;; ADDITIONAL SECTION:
ns1.example.net.    14400    IN    A    192.168.1.88
ns2.example.net.    14400    IN    A    192.168.1.88

;; Query time: 1 msec
;; SERVER: 192.168.1.88#53(192.168.1.88)
;; WHEN: Fri Dec 12 10:10:29 WIB 2014
;; MSG SIZE  rcvd: 118

Good, dns server work now for my CentOS 7 minimal installation :-)

How to install Apache, MariaDB and PHP on CentOS 7 minimal

After install and configure network under CentOS 7 minimal I continue with LAMP section. Since the machine has 4GB memory I prefer to use old fashion LAMP. Only switch MySQL with MariaDB :-)

The steps for LAMP installation for my own reference and my vps need :

Install required Package

Install nano

# yum install nano

Install Apache, PHP and MariaDB

# yum install httpd mariadb-server mariadb php php-mysql php-mysqli php-gd php-pear php-mbstring

Configure Apache

Start httpd

# systemctl start httpd.service

Set httpd to auto start after reboot or boot process

# systemctl enable httpd.service
ln -s ‘/usr/lib/systemd/system/httpd.service’ ‘/etc/systemd/system/multi-user.target.wants/httpd.service’

By default firewall will block access. To exclude http from firewall block :

# firewall-cmd --permanent --add-service http

# systemctl restart firewalld.service

Try visit ip address from browser

httpd_centos7

Configure MariaDB

Start mariadb

# systemctl start mariadb

Set mariadb to autostart

# systemctl enable mariadb.service
ln -s ‘/usr/lib/systemd/system/mariadb.service’ ‘/etc/systemd/system/multi-user.target.wants/mariadb.service’

Set password for mariadb, delete unnecessary database and users.

# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user.  If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
… Success!

Normally, root should only be allowed to connect from ‘localhost’.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
… Success!

By default, MariaDB comes with a database named ‘test’ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up…

All done!  If you’ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

I also need to enable firewall to exclude future database remote backup. Port 3306 is required to open.

# firewall-cmd --permanent --add-port=3306/tcp
success
# systemctl restart firewalld.service

Done.

Next step is measure time needed from start server to get login display and make my report.

IBM X3250 M5 and Minimal CentOS 7

New server come. Its a IBM X3250 M5 with single HD 1TB Sata 7200 RPM. I can not see it from bios setting, my FreeBSD 9.2 CD also unable to detect it but I’ve not try it using FreeBSD 10. As I ever see various case that related with storage detection then I quickly switch to CentOS.

My preference will be CentOS 5.xx version due to application requirement (php 5.2) but now its no longer relevance. I can use newest php version and I think CentOS 7 will be fit. It will overcome storage detection and perhaps I can learn new things.

Installation work smooth since I choose DVD version but I work with minimal installation. A few notes around Minimal CentOS 7 :

# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)

No ifconfig command in minimal CentOS 7

# ifconfig
bash: ifconfig: command not found

Ip addr to see all network setting

# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s26u1u2u5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 6e:ae:8b:5a:68:67 brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 6c:ae:8b:5a:68:60 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.88/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::6eae:8bff:fe5a:6860/64 scope link
valid_lft forever preferred_lft forever
4: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 6c:ae:8b:5a:68:61 brd ff:ff:ff:ff:ff:ff

nmcli is new friend

# nmcli -p con
=============================================================================
NetworkManager connection profiles
=============================================================================
NAME           UUID                                  TYPE            DEVICE
—————————————————————————–
enp0s26u1u2u5  4ca8bc8e-74c5-4578-ab34-895c1c6cb7a1  802-3-ethernet  —
eno1           598b49c6-9adf-4fb7-96ee-22ebd2ee15bf  802-3-ethernet  —
eth0           2c0edb26-c2ad-42f5-80f3-3bd69b1e27e5  802-3-ethernet  eth0

Edit connection using nmtui

#nmtui

you’ll see screen like this

network manager TUI

more

edit network setting under nmtui

edit anything you want

complete network change using nmtui

The interface is pretty clear and enough for me but if really need ifconfig command

# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: kartolo.sby.datautama.net.id
* extras: kartolo.sby.datautama.net.id
* updates: kartolo.sby.datautama.net.id
Resolving Dependencies
–> Running transaction check
—> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package                               Arch                               Version                                                Repository                        Size
========================================================================================================================================================================
Installing:
net-tools                             x86_64                             2.0-0.17.20131004git.el7                               base                             304 k

Transaction Summary
========================================================================================================================================================================
Install  1 Package

Total download size: 304 k
Installed size: 917 k
Is this ok [y/d/N]: y

Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/net-tools-2.0-0.17.20131004git.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY76 kB  00:00:00 ETA
Public key for net-tools-2.0-0.17.20131004git.el7.x86_64.rpm is not installed
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm                                                                                                    | 304 kB  00:00:03
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid     : “CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>”
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package    : centos-release-7-0.1406.el7.centos.2.3.x86_64 (@anaconda)
From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : net-tools-2.0-0.17.20131004git.el7.x86_64                                                                                                            1/1
Verifying  : net-tools-2.0-0.17.20131004git.el7.x86_64                                                                                                            1/1

Installed:
net-tools.x86_64 0:2.0-0.17.20131004git.el7

Complete!

network scripts still there

# ls /etc/sysconfig/network-scripts/
ifcfg-eno1           ifdown       ifdown-ipv6  ifdown-routes    ifdown-tunnel  ifup-eth   ifup-plip   ifup-routes    ifup-tunnel        network-functions-ipv6
ifcfg-enp0s26u1u2u5  ifdown-bnep  ifdown-isdn  ifdown-sit       ifup           ifup-ippp  ifup-plusb  ifup-sit       ifup-wireless
ifcfg-eth0           ifdown-eth   ifdown-post  ifdown-Team      ifup-aliases   ifup-ipv6  ifup-post   ifup-Team      init.ipv6-global
ifcfg-lo             ifdown-ippp  ifdown-ppp   ifdown-TeamPort  ifup-bnep      ifup-isdn  ifup-ppp    ifup-TeamPort  network-functions

# cat ifcfg-eth0
TYPE=”Ethernet”
BOOTPROTO=”none”
DEFROUTE=”yes”
IPV4_FAILURE_FATAL=”no”
IPV6INIT=”yes”
IPV6_AUTOCONF=”yes”
IPV6_DEFROUTE=”yes”
IPV6_FAILURE_FATAL=”no”
NAME=”eth0″
UUID=”2c0edb26-c2ad-42f5-80f3-3bd69b1e27e5″
ONBOOT=”yes”
HWADDR=”6C:AE:8B:5A:68:60″
IPADDR0=”192.168.1.88″
PREFIX0=”24″
GATEWAY0=”192.168.1.1″
DNS1=”192.168.1.1″
DOMAIN=”google.com”
IPV6_PEERDNS=”yes”
IPV6_PEERROUTES=”yes”

Free memory before install LAMP

# free -m
total       used       free     shared    buffers     cached
Mem:          3629        534       3095          8          1        342
-/+ buffers/cache:        189       3439
Swap:         3855          0       3855

# df -H
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   54G  1,1G   53G   2% /
devtmpfs                 1,9G     0  1,9G   0% /dev
tmpfs                    2,0G     0  2,0G   0% /dev/shm
tmpfs                    2,0G  9,0M  1,9G   1% /run
tmpfs                    2,0G     0  2,0G   0% /sys/fs/cgroup
/dev/sda2                521M   93M  429M  18% /boot
/dev/mapper/centos-home  942G   34M  942G   1% /home
/dev/sda1                210M   10M  200M   5% /boot/efi

So far its great :-)

How to install FTP Server (pure-ftp) on FreeBSD 10.1

This is 3rd post from virtual user hosting with FreeBSD 10 series. First two are located here :

  1. How to install virtual Ftp hosting with PureFTP on FreeBSD 10 : Part 1 – Setup
  2. How to install virtual Ftp hosting with PureFTP on FreeBSD 10 : Part 2 – TLS & Unix Auth

I restart the process using latest FreeBSD version at the moment : FreeBSD 10.1 using custom iso.

Some highlight from FreeBSD 10.1-RELEASE announcement :

  • The new console driver, vt(4), has been added.
  • Support for FreeBSD/i386 guests has been added to bhyve(4).
  • The bhyve(4) hypervisor now supports booting from a zfs(8) filesystem.
  • Support for SMP was added to the armv6 kernels and enabled by default in the configuration files for all platforms that contain multi-core CPUs.
  • Initial support for UEFI boot has been added for the FreeBSD/amd64 architecture.
  • Support has been added to cache geli(8) passphrases during system boot.
  • Support for the UDP-Lite protocol (RFC 3828) has been added to the IPv4 and IPv6 stacks.
  • The new filesystem automount facility, autofs(5), has been added.
  • The sshd(8) rc.d(8) startup script now generates ED25519 sshd(8) host keys if keys do not already exist when ssh_keygen_alg() is invoked.
  • OpenSSH has been updated to version 6.6p1.
  • The nc(1) utility has been updated to match the version in OpenBSD 5.5.
  • Sendmail has been updated to 8.14.9.
  • The unbound(8) caching resolver and ldns have been updated to version 1.4.22.
  • OpenPAM has been updated to Ourouparia (20140912).
  • OpenSSL has been updated to version 1.0.1j.
  • The pkg(8) package management utility has been updated to version 1.3.8.

Back to process :-)

# uname -rsv
FreeBSD 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 22:51:51 UTC 2014     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC

Update Package

# pkg update
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
………………………………..

…………………………………………

…………………………………………………..
Updating FreeBSD repository catalogue…
Fetching meta.txz: 100%   944 B   0.9k/s    00:01
Fetching digests.txz: 100%    2 MB 108.8k/s    00:19
Fetching packagesite.txz: 100%    5 MB  95.6k/s    00:56
Processing new repository entries: 100%
FreeBSD repository update completed. 23787 packages processed:
0 updated, 0 removed and 23787 added.

Install Ports

# portsnap fetch

# portsnap extract

# cd /usr/ports/ftp/pure-ftpd/

pure-ftpd-freebsd options

To reduce dependency compile process (download and install for each dependency), I ask for pkg help :

# pkg install dialog4ports mysql55-client perl5

Resume make install process of pure-ftp ports.

# make install

Check everything

# pkg info
dialog4ports-0.1.5_2           Console Interface to configure ports
mysql55-client-5.5.40          Multithreaded SQL database (client)
perl5-5.16.3_11                Practical Extraction and Report Language
pkg-1.3.8_3                    Package manager
pure-ftpd-1.0.36_3             Small, easy to set up, fast, and secure FTP server

Enable pureftp

#echo 'pureftpd_enable=YES' >>/etc/rc.conf

Since I want MySQL support for pure-ftp then I install MySQL server.

# pkg install mysql55-server

Enable MySQL server to start automatically after server reboot.

# echo 'mysql_enable=YES' >> /etc/rc.conf

Start MySQL server

# /usr/local/etc/rc.d/mysql-server start

According to pure-ftpd manual (mysql section).

Table structure for hold virtual user as follows :

CREATE TABLE users (
  User VARCHAR(16) BINARY NOT NULL,
  Password VARCHAR(64) BINARY NOT NULL,
  Uid INT(11) NOT NULL default '-1',
  Gid INT(11) NOT NULL default '-1',
  Dir VARCHAR(128) BINARY NOT NULL,
  PRIMARY KEY  (User)
);

Lets create that table.

# cat /etc/master.passwd | grep mysql
mysql:*:88:88::0:0:MySQL Daemon:/var/db/mysql:/usr/sbin/nologin

In my opinion Uid and Gid is 88. But as pure-ftpd manual said about 1000. I use it.

Ok, lets log in to MySQL database and insert user :

# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.40 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> create database ftp;
Query OK, 1 row affected (0.01 sec)

mysql> use ftp;
Database changed
mysql> CREATE TABLE users (
->   User VARCHAR(16) BINARY NOT NULL,
->   Password VARCHAR(64) BINARY NOT NULL,
->   Uid INT(11) NOT NULL default ‘-1’,
->   Gid INT(11) NOT NULL default ‘-1′,
->   Dir VARCHAR(128) BINARY NOT NULL,
->   PRIMARY KEY  (User)
-> );
Query OK, 0 rows affected (0.02 sec)

mysql> insert into users set User=’alamsyah’,Password=md5(‘123456′), Uid=1000,Gid=1000,Dir=’/home/ftpdata/alamsyah’;
Query OK, 1 row affected (0.00 sec)

mysql>

The command above work : log in to database, create database named ‘ftp’ . Choose database ‘ftp’. Create table named ‘users’ with its structure and insert data into the table.

At this stage pure-ftpd is running, MySQL server also running. Example user also take place.

Configuration

Create directory

# mkdir -p /home/ftpdata

To be able to read MySQL data, purfe-ftpd.conf need to know that.

# cd /usr/local/etc/

# mv pure-ftpd.conf.sample pure-ftpd.conf

# ee pure-ftpd.conf

remove # sign in front of MySQLConfigFile

from

# MySQL configuration file (see README.MySQL)

# MySQLConfigFile               /etc/pureftpd-mysql.conf

# CreateHomeDir               yes

into

# MySQL configuration file (see README.MySQL)

MySQLConfigFile               /usr/local/etc/pureftpd-mysql.conf

CreateHomeDir               yes

save the file.

Next step is create mysql configuration file and fill the data.

# mv pureftpd-mysql.conf.sample pureftpd-mysql.conf

# ee pureftpd-mysql.conf

The file content is well explained.

From these lines :

MYSQLUser       root

# Mandatory : user password. You must have a password.

MYSQLPassword   rootpw

# Mandatory : database to open.

MYSQLDatabase   pureftpd

# Mandatory : how passwords are stored
# Valid values are : “cleartext”, “crypt”, “sha1”, “md5” and “password”
# (“password” = MySQL password() function)
# You can also use “any” to try “crypt”, “sha1”, “md5” *and* “password”

MYSQLCrypt      cleartext

You need to change a few lines :

MysqlUser : root -> keep this as is.

MysqlPassword : not set yet, change to anything designed. For example ‘123456secret’.

MysqlDatabase : ftp (this database already created in above step).

MySQLCrypt : md5 (user alam in previous step use md5)

The rest is not changed.

save the file.

Next step is change mysql password for user root to : 123456secret.

# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.40 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=password(‘123456secret’) where user=’root’;
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql>

Test it

# ftp localhost
Trying 127.0.0.1:21 …
Connected to localhost.
220———- Welcome to Pure-FTPd [privsep] [TLS] ———-
220-You are user number 1 of 50 allowed.
220-Local time is now 13:42. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (localhost:alam): alamsyah
331 User alamsyah OK. Password required
Password:
230 OK. Current restricted directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
229 Extended Passive mode OK (|||46398|)
150 Accepted data connection
drwxr-xr-x    2 1000       1000              512 Nov 22 13:42 .
drwxr-xr-x    2 1000       1000              512 Nov 22 13:42 ..
226-Options: -a -l
226 2 matches total
ftp>

If anything is not right then you may refer to log

# tail -f /var/log/messages

If you need to enable TLS you refer to 2nd post.

See you next time!