This file (C) Yann Guidon 2015-09-25 ******************************************************* If you want to use the keyboard, log in as pi:pi from ssh and run sudo raspi-config then select the desired locale and keyboard configuration. Network is configured first in DHCP. The IP address is displayed on the HDMI console before the login prompt. You will probably have to reconfigure your network mask or subnet. ******************************************************* These are the operations that I have performed to create the provided image file. Starting with https://www.raspberrypi.org/downloads/raspbian/ : Raspbian Debian Wheezy Version: May 2015 Release date: 2015-05-05 Kernel version: 3.18 SHA-1: cb799af077930ff7cbcfaa251b4c6e25b11483de click "Download ZIP" => [yg@localhost ~]$ cd /data/RPi [yg@localhost RPi]$ wget 'https://downloads.raspberrypi.org/raspbian_latest' --2015-09-25 23:11:36-- https://downloads.raspberrypi.org/raspbian_latest Résolution de downloads.raspberrypi.org (downloads.raspberrypi.org)… 93.93.128.230, 93.93.130.39, 93.93.128.211, ... Connexion à downloads.raspberrypi.org (downloads.raspberrypi.org)|93.93.128.230|:443… connecté. requête HTTP transmise, en attente de la réponse… 302 Found Emplacement : https://downloads.raspberrypi.org/raspbian/images/raspbian-2015-05-07/2015-05-05-raspbian-wheezy.zip [suivant] --2015-09-25 23:11:36-- https://downloads.raspberrypi.org/raspbian/images/raspbian-2015-05-07/2015-05-05-raspbian-wheezy.zip Réutilisation de la connexion existante à downloads.raspberrypi.org:443. requête HTTP transmise, en attente de la réponse… 302 Found Emplacement : http://director.downloads.raspberrypi.org/raspbian/images/raspbian-2015-05-07/2015-05-05-raspbian-wheezy.zip [suivant] --2015-09-25 23:11:36-- http://director.downloads.raspberrypi.org/raspbian/images/raspbian-2015-05-07/2015-05-05-raspbian-wheezy.zip Résolution de director.downloads.raspberrypi.org (director.downloads.raspberrypi.org)… 93.93.128.230, 93.93.130.214, 93.93.130.39, ... Connexion à director.downloads.raspberrypi.org (director.downloads.raspberrypi.org)|93.93.128.230|:80… connecté. requête HTTP transmise, en attente de la réponse… 302 Moved temporarily Emplacement : http://files.velocix.com/c1410/newdownloads/raspbian/images/raspbian-2015-05-07/2015-05-05-raspbian-wheezy.zip [suivant] --2015-09-25 23:11:36-- http://files.velocix.com/c1410/newdownloads/raspbian/images/raspbian-2015-05-07/2015-05-05-raspbian-wheezy.zip Résolution de files.velocix.com (files.velocix.com)… 212.187.212.226 Connexion à files.velocix.com (files.velocix.com)|212.187.212.226|:80… connecté. requête HTTP transmise, en attente de la réponse… 302 Found Emplacement : http://93.174.97.26/bt/0e19598eba0e05d0be045394081575189cdaf075/data/2015-05-05-raspbian-wheezy.zip [suivant] --2015-09-25 23:11:37-- http://93.174.97.26/bt/0e19598eba0e05d0be045394081575189cdaf075/data/2015-05-05-raspbian-wheezy.zip Connexion à 93.174.97.26:80… connecté. requête HTTP transmise, en attente de la réponse… 200 OK Taille : 1038523231 (990M) [application/zip] Sauvegarde en : « raspbian_latest » raspbian_latest 0%[ ] 4,59M 650KB/s eta 26m 9ss raspbian_latest 100%[=========================================================>] 990,41M 650KB/s ds 26m 2s s 2015-09-25 23:37:38 (649 KB/s) — « raspbian_latest » sauvegardé [1038523231/1038523231] WOW! 1GB compressed ! [yg@localhost RPi]$ mv raspbian_latest 2015-05-05-raspbian-wheezy.img.zip [yg@localhost RPi]$ shasum 2015-05-05-raspbian-wheezy.img.zip cb799af077930ff7cbcfaa251b4c6e25b11483de 2015-05-05-raspbian-wheezy.img.zip OK [yg@localhost RPi]$ /usr/bin/time unzip 2015-05-05-raspbian-wheezy.img.zip Archive: 2015-05-05-raspbian-wheezy.img.zip inflating: 2015-05-05-raspbian-wheezy.img 23.55user 3.75system 0:59.56elapsed 45%CPU (0avgtext+0avgdata 2860maxresident)k 597712inputs+6400000outputs (1major+291minor)pagefaults 0swaps [yg@localhost RPi]$ ls -al -rw-r--r--. 1 yg yg 3276800000 7 mai 01:00 2015-05-05-raspbian-wheezy.img -rw-rw-r--. 1 yg yg 1038523231 7 mai 17:55 2015-05-05-raspbian-wheezy.img.zip [yg@localhost RPi]$ shasum 2015-05-05-raspbian-wheezy.img fd11a319a8e93fc5f93902c67d337ad419706e5e 2015-05-05-raspbian-wheezy.img [root@localhost RPi]# dd if=2015-05-05-raspbian-wheezy.img of=/dev/mmcblk0 bs=4M 781+1 enregistrements lus 781+1 enregistrements écrits 3276800000 octets (3,3 GB) copiés, 406,104 s, 8,1 MB/s [root@localhost RPi]# sync -----o-oo-00O00-oo-o----- Connecting the Pi B+ : - uSD card - USB keyboard - Ethernet - HDMI - Power supply Power-on : boot messages appear, raspiconf starts Expand Filesystem : no (this keeps a 3276800000 bytes image file size) Change user Password : pi Enable Boot to : Text Console Internationalisation : Locale : fr_FR.UTF8 Timezone : Europe / Paris Keyboard Layout : Generic 105-key (Intl) PC -> other -> French -> French - French (legacy, alternative) AltGr : "The default for the keyboard layout" No compose key No Ctrl+Alt+BckSpc for X (X11 will be removed) Enable Camera : Disable (unused) Overclock : none Advanced options : A1 Overscan : disable A2 Hostname : pi A3 Memory Split : 16 (no graphics for us) A4 SSH : enabled (often used) A5 Device Tree : necessary for Pi2 A6 SPI : Disabled A7 I2C : Disabled A8 Serial : Disabled A9 Audio : Jack A0 Update : done $ sudo reboot ___________________________________________________ ==> dhcp lease at 192.168.41.13 pi@pi ~ $ sudo apt-get remove pistore menu menu-xdg wolfram-engine oracle-java8-jdk squeak-plugins-scratch desktop-base dillo \ netsurf-common libx11-data x2x omxplayer lightdm lxde-common lxrandr lxsession lxterminal openbox raspberrypi-artwork weston x11-common \ x11-utils xfonts-utils x11-xkb-utils xinit xserver-common xserver-xorg pcmanfm minecraft-pi penguinspuzzle python-minecraftpi aspell \ aspell-en dictionaries-common ghostscript xpdf freepats supercollider timidity esound-common libvisual-0.4-plugins libscsynth1 \ libsclang1 ruby1.9.1 idle cifs-utils libpango1.0-0 libtiff4 cups-common cups-client cups-bsd hicolor-icon-theme libgtk-3-bin \ libgtk-3-common libgtk2.0-common libgtk2.0-bin libwildmidi-config plymouth poppler-data lxde lxde-core galculator blt gvfs lesstif2 \ libaspell15 libass4 libatk1.0-0 libfreetype6-dev libxapian-dev java-common gpicview epiphany-browser zenity gvfs-fuse gtk2-engines \ gnome-icon-theme gsfonts ttf-dejavu-core tsconf smartsim scratch leafpad vim-common pypy-upstream-doc git-man lxde-icon-theme \ lxmenu-data xkb-data qdbus libpaper-utils fontconfig fontconfig-config fonts-droid fonts-freefont-ttf zenity-common \ gsettings-desktop-schemas gnome-themes-standard-data gnome-desktop3-data lua5.1 luajit gir1.2-glib-2.0 gconf-service gconf2-common \ gstreamer1.0-plugins-base gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-omx libyaml-0-2 libxfont1 libxdmcp6 libxcb-xfixes0 \ libxcb-shm0 libxcb-shape0 libxcb-render0 libxcb-glx0 libxau6 libxapian22 libwnck-common libwnck-3-common libwebp2 \ libwebkitgtk-3.0-common libwayland0 libvte-common libthai0 libthai-data libsecret-1-0 libsecret-common libruby1.9.1 libopenexr6 \ libpaper1 libpciaccess0 libpixman-1-0 libqtcore4 libqtdbus4 libqt4-network libmikmod2 Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires : fonts-roboto fuse gettext-base gstreamer0.10-alsa gstreamer0.10-plugins-base libasprintf0c2 libaudiofile1 libaudit0 libcwiid1 liberror-perl libfile-copy-recursive-perl libfm-data libfm-extra4 libfm-gtk-data libfuse2 libgif4 libgs9-common libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 libid3tag0 libijs-0.35 libjbig2dec0 libluajit-5.1-common libmad0 libmenu-cache1 libmtdev1 libpng12-dev libportmidi0 libssh-4 libutempter0 libvorbisfile3 libxfce4util-bin libxfce4util-common libxfce4util4 lxpanel-data rsync smbclient supercollider-common tcl8.5 triggerhappy update-inetd xbitmaps xfce-keyboard-shortcuts Veuillez utiliser « apt-get autoremove » pour les supprimer. Les paquets supplémentaires suivants seront installés : libcups2 Les paquets suivants seront ENLEVÉS : aptitude aspell aspell-en blt cifs-utils console-setup consolekit cups-bsd cups-client cups-common dbus-x11 desktop-base dictionaries-common dillo epiphany-browser esound-common fontconfig fontconfig-config fonts-droid fonts-freefont-ttf freepats galculator gconf-service gconf2 gconf2-common ghostscript gir1.2-glib-2.0 git git-core git-man gksu glib-networking gnome-desktop3-data gnome-icon-theme gnome-icon-theme-symbolic gnome-themes-standard gnome-themes-standard-data gpicview gsettings-desktop-schemas gsfonts gsfonts-x11 gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-omx gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-x gtk2-engines gvfs gvfs-backends gvfs-daemons gvfs-fuse hicolor-icon-theme idle idle-python2.7 idle-python3.2 idle3 java-common leafpad lesstif2 libaa1 libaspell15 libass4 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libaudio2 libcairo-gobject2 libcairo2 libcupsimage2 libdirectfb-1.2-9 libenchant1c2a libept-dev libept1.4.12 libesd0 libfltk1.3 libfluidsynth1 libfm-gtk4 libfm-modules libfm4 libfontconfig1 libfreetype6-dev libgconf-2-4 libgd2-xpm libgdk-pixbuf2.0-0 libgksu2-0 libgl1-mesa-glx libglade2-0 libglu1-mesa libgnome-desktop-3-2 libgphoto2-2 libgs9 libgtk-3-0 libgtk-3-bin libgtk-3-common libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgtop2-7 libice6 libimlib2 liblightdm-gobject-1-0 libmikmod2 libnotify4 libobrender27 libobt0 libopencv-contrib2.4 libopencv-highgui2.4 libopencv-legacy2.4 libopencv-objdetect2.4 libopencv-videostab2.4 libopenexr6 libpango-1.0-0 libpango1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpangox-1.0-0 libpangoxft-1.0-0 libpaper-utils libpaper1 libpciaccess0 libpixman-1-0 libpoppler19 libpulse0 libqscintilla2-8 libqt4-dbus libqt4-network libqt4-svg libqt4-xml libqtcore4 libqtdbus4 libqtgui4 libqtwebkit4 librsvg2-2 librsvg2-common libruby1.9.1 libsclang1 libscsynth1 libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0 libsdl1.2debian libsecret-1-0 libsecret-common libsm6 libsmpeg0 libsoup-gnome2.4-1 libsoup2.4-1 libspandsp2 libstartup-notification0 libthai-data libthai0 libtiff4 libts-0.0-0 libvisual-0.4-plugins libvte-common libvte9 libwayland0 libwebkitgtk-3.0-0 libwebkitgtk-3.0-common libwebp2 libwildmidi-config libwildmidi1 libwnck-3-0 libwnck-3-common libwnck-common libwnck22 libx11-6 libx11-data libx11-xcb1 libxapian-dev libxapian22 libxau6 libxaw7 libxcb-glx0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-util0 libxcb-xfixes0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfce4ui-1-0 libxfconf-0-2 libxfixes3 libxfont1 libxft2 libxi6 libxinerama1 libxkbcommon0 libxkbfile1 libxklavier16 libxmu6 libxmuu1 libxp6 libxpm4 libxrandr2 libxrender1 libxres1 libxss1 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 libyaml-0-2 libzbar0 lightdm lightdm-gtk-greeter lua5.1 luajit lxappearance lxde lxde-common lxde-core lxde-icon-theme lxinput lxmenu-data lxpanel lxpolkit lxrandr lxsession lxsession-edit lxshortcut lxtask lxterminal menu menu-xdg minecraft-pi mountall netsurf-common netsurf-gtk nuscratch obconf omxplayer openbox oracle-java8-jdk pcmanfm penguinspuzzle pipanel pistore plymouth policykit-1 poppler-data poppler-utils pypy-setuptools pypy-upstream pypy-upstream-dev pypy-upstream-doc python-gi python-minecraftpi python-pygame python-tk python3-minecraftpi python3-pygame python3-tk qdbus qjackctl raspberrypi-artwork raspberrypi-net-mods raspberrypi-ui-mods raspi-config ruby1.9.1 scratch smartsim sonic-pi squeak-plugins-scratch squeak-vm supercollider supercollider-server timidity tk8.5 tsconf ttf-dejavu-core vim-common vim-tiny weston wolfram-engine wpagui x11-common x11-utils x11-xkb-utils x11-xserver-utils x2x xarchiver xauth xfce4-mixer xfconf xfonts-encodings xfonts-utils xinit xkb-data xpdf xserver-common xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-xorg-video-fbdev xserver-xorg-video-fbturbo zenity zenity-common Les paquets suivants seront mis à jour : libcups2 1 mis à jour, 0 nouvellement installés, 308 à enlever et 28 non mis à jour. Il est nécessaire de prendre 238 ko dans les archives. Après cette opération, 1 334 Mo d'espace disque seront libérés. Souhaitez-vous continuer [O/n] ? Oh yes I want to continue... and get rid of 1.3GB of useless stuff. Réception de : 1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libcups2 armhf 1.5.3-5+deb7u6 [238 kB] 238 ko réceptionnés en 0s (294 ko/s) (Lecture de la base de données... 77851 fichiers et répertoires déjà installés.) Suppression de aptitude ... Suppression de raspberrypi-net-mods ... Suppression de raspberrypi-ui-mods ... ......... pi@pi ~ $ df Sys. fich. 1K-blocks Util. Disponible Uti% Monté sur rootfs 3023728 1097604 1752812 39% / /dev/root 3023728 1097604 1752812 39% / devtmpfs 243020 0 243020 0% /dev tmpfs 49460 236 49224 1% /run tmpfs 5120 0 5120 0% /run/lock tmpfs 98900 0 98900 0% /run/shm /dev/mmcblk0p1 57288 19400 37888 34% /boot 1GB used now, but we can do better. pi@pi ~ $ sudo apt-get remove libcups2 pi@pi ~ $ sudo apt-get autoremove pi@pi ~ $ df Sys. fich. 1K-blocks Util. Disponible Uti% Monté sur rootfs 3023728 841632 2008784 30% / better, indeed. Aptitude and raspi-config have been wiped, let's restore them (and add gpm for easy copy-paste !) : pi@pi ~ $ sudo apt-get install aptitude raspi-config gpm (I also added sox but that was useless so i removed it again) More useless packages are found with aptitude : pi@pi ~ $ sudo apt-get remove xz-utils xdg-utils v4l-utils triggerhappy hardlink fbset pciutils alsa-base alsa-utils ncdu desktop-file-utils info install-info pi@pi ~ $ sudo apt-get autoremove pi@pi ~ $ sudo apt-get update pi@pi ~ $ sudo apt-get upgrade pi@pi ~ $ sudo apt-get purge pi@pi ~ $ sudo apt-get clean pi@pi ~ $ df Sys. fich. 1K-blocks Util. Disponible Uti% Monté sur rootfs 3023728 877320 1973096 31% / Personalisation : $ cd $ rm -r python_games $ sudo su root@pi:/home/pi# echo "alias l='ls -al'" >> /etc/bash.bashrc Network / IP configuration : nano /etc/network/interfaces ==> auto lo iface lo inet loopback auto eth0 allow-hotplug eth0 iface eth0 inet static address 192.168.41.100 netmask 255.255.255.0 gateway 192.168.41.1 broadcast 192.168.41.255 root@pi:/home/pi# du /usr/share/doc 41360 /usr/share/doc cd /usr/share/locale/ root@pi:/usr/share/locale# du 77420 . root@pi:/usr/share/locale# rm -r $(ls |grep -v fr |grep -v en) root@pi:/usr/share/locale# rm -r ca\@valencia en_AU/ 'en@'* en_CA en_NZ root@pi:/usr/share/locale# du 4020 . root@pi:/usr/share# cd /usr/share/ root@pi:/usr/share# rm -r nfs-common dict icons info pixmaps root@pi:/usr/share# apt-get install locate root@pi:/usr/share# updatedb root@pi:/usr/share# apt-get remove libgeoip1 libgfortran3 libraspberrypi0 root@pi:/usr/share# cd man root@pi:/usr/share/man# rm -r cs da de es fi fr.ISO8859-1 gl hu id it ja ko nl pl pt pt_BR ru sl sv tr zh_CN zh_TW root@pi:# cd /etc/ root@pi:/etc# rm -r xpdf X11 xdg wildmidi lightdm plymouth ghostscript weston timidity root@pi:/etc# apt-get remove cron anacron ==> better real time ! root@pi:~# rm -r /etc/cron* (yeah because it wasn't removed...) root@pi:/# apt-get remove ntp ==> prevents real-time hickups or network traffic root@pi:/etc# rm -r /etc/init.d/ntp /etc/rc?.d/S??ntp /etc/ntp.conf /var/lib/ntp root@pi:~# df Sys. fich. 1K-blocks Util. Disponible Uti% Monté sur rootfs 3023728 637828 2212588 23% / root@pi:/# rm /var/cache/apt-xapian-index/index.1/* root@pi:/# df Sys. fich. 1K-blocks Util. Disponible Uti% Monté sur rootfs 3023728 475588 2374828 17% / 60MB saved and apt still works ! /var/cache/apt still uses 53MB... ***************************************************************************** HARDENING : configure the file system in read-only mode to prevent flash wear and all sorts of fs corruptions ***************************************************************************** First remove the swap : root@pi:~# cd /etc/ root@pi:/etc# cat dphys-swapfile CONF_SWAPSIZE=100 root@pi:/etc# echo CONF_SWAPSIZE=0 > dphys-swapfile root@pi:/etc# dphys-swapfile swapoff root@pi:/etc# dphys-swapfile setup want /var/swap=0MByte, checking existing root@pi:/etc# l /var/swap init.d/dphys-swapfile /sbin/dphys-swapfile /etc/dphys-swapfile /etc/rc?.d/*dphys-swapfile -rw-r--r-- 1 root root 16 sept. 26 03:40 /etc/dphys-swapfile lrwxrwxrwx 1 root root 24 mai 7 00:39 /etc/rc2.d/S02dphys-swapfile -> ../init.d/dphys-swapfile lrwxrwxrwx 1 root root 24 mai 7 00:39 /etc/rc3.d/S02dphys-swapfile -> ../init.d/dphys-swapfile lrwxrwxrwx 1 root root 24 mai 7 00:39 /etc/rc4.d/S02dphys-swapfile -> ../init.d/dphys-swapfile lrwxrwxrwx 1 root root 24 mai 7 00:39 /etc/rc5.d/S02dphys-swapfile -> ../init.d/dphys-swapfile -rwxr-xr-x 1 root root 2148 juin 9 2012 init.d/dphys-swapfile -rwxr-xr-x 1 root root 5697 juin 9 2012 /sbin/dphys-swapfile -rw------- 1 root root 104857600 mai 7 01:29 /var/swap YAY ! 100MB more to free :-) root@pi:/etc# rm /var/swap init.d/dphys-swapfile /sbin/dphys-swapfile /etc/dphys-swapfile /etc/rc?.d/*dphys-swapfile root@pi:/etc# df Sys. fich. 1K-blocks Util. Disponible Uti% Monté sur rootfs 3023728 535412 2315004 19% / isn't it better ? ;-) root@pi:/etc# ln -s /var/run/adjtime /etc/adjtime root@pi:/etc# nano /etc/init.d/hwclock.sh line 60 : if [ -w /etc ] && [ ! -L /etc/adjtime ] && [ ! -e /etc/adjtime ]; then (-f changed to -L) root@pi:/etc# rm /etc/mtab ; ln -s /proc/self/mounts /etc/mtab root@pi:/etc# echo 'BLKID_FILE="/var/run/blkid.tab"' >> /etc/environment root@pi:/etc# echo "RAMTMP=yes" >> /etc/default/rcS Changing all fs to read-only or RAM : root@pi:/etc# nano fstab (new contents: ) proc /proc proc defaults 0 0 tmpfs /var/log tmpfs nodev,nosuid,size=10M,mode=1777 0 0 tmpfs /tmp tmpfs nodev,nosuid,size=10M,mode=1777 0 0 /dev/mmcblk0p1 /boot vfat defaults,ro 0 2 /dev/mmcblk0p2 / ext4 defaults,noatime,ro,errors=remount-ro 0 1 Modification of /etc/rc.local : root@pi:/etc# nano /etc/rc.local .... # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" /usr/sbin/sshd  # <--added! fi root@pi:/etc# nano /etc/init.d/ssh ... Line 79: case "$1" in start) mkdir /var/run/sshd # <--added check_privsep_dir check_for_no_start Remount the filesystem whenever we log in and it's read only : root@pi:/etc# echo "mount|grep ' on / '|grep '(ro,' && echo \"remount RW\" && sudo mount -o remount,rw /" >> /etc/profile ____________________ reboot ____________________ DHCPCD is not happy... Network configuration conflict. I leave the default DHCP configuration and comment my static IP config out, so new users can access the Pi as easily and possible, then switch to static if necessary. And the keyboard settings are broken, back to QWERTY... I must have removed one too many essential package. Bringing back the uSD card on the Linux workstation to cleanup the filesystem and package the new image. [root@localhost blk0p2]# dd if=/dev/zero of=ZERO bs=1K dd: erreur d'écriture de « ZERO »: Aucun espace disponible sur le périphérique 2481949+0 enregistrements lus 2481948+0 enregistrements écrits 2541514752 octets (2,5 GB) copiés, 603,561 s, 4,2 MB/s [root@localhost blk0p2]# sync [root@localhost blk0p2]# rm ZERO [root@localhost blk0p2]# cd /RPi [root@localhost RPi]# umount /blk0p2 [root@localhost RPi]# dd if=/dev/mmcblk0 of=2015-09-26_Raspbian_Hardened.3276800000.img bs=32768 count=100000 100000+0 enregistrements lus 100000+0 enregistrements écrits 3276800000 octets (3,3 GB) copiés, 325,643 s, 10,1 MB/s [root@localhost RPi]# sha1sum 2015-09-26_Raspbian_Hardened.3276800000.img 694fc3dca01f8393675d5e7dbc705ec371af7554 2015-09-26_Raspbian_Hardened.3276800000.img [root@localhost RPi]# gzip -k 2015-09-26_Raspbian_Hardened.3276800000.img [root@localhost RPi]# sha1sum 2015-09-26_Raspbian_Hardened.3276800000.img.gz 4cec82c359ab7e8d0b74976309f9243f091b819b 2015-09-26_Raspbian_Hardened.3276800000.img.gz [root@localhost RPi]# l 2015-09-26_Raspbian_Hardened.3276800000.img* -rw-r--r--. 1 yg yg 3276800000 26 sept. 06:27 2015-09-26_Raspbian_Hardened.3276800000.img -rw-r--r--. 1 yg yg 200269221 26 sept. 06:27 2015-09-26_Raspbian_Hardened.3276800000.img.gz Voila !