Outils pour utilisateurs

Outils du site


blog

Notes fuseau horaire - timezone TZ - localtime - heure locale

Voir :

Choisir le fuseau horaire, pour la France :

ln -snf /usr/share/zoneinfo/Europe/Paris /etc/localtime
echo "Europe/Paris" > /etc/timezone

Ou

timedatectl set-timezone Europe/Paris

Changer de fuseau horaire

La procédure pour changer de fuseau horaire est assez simple. Il s'agit en fait de changer le fichier /etc/localtime à partir du bon fuseau dans /usr/share/zoneinfo.

Par exemple, pour choisir le fuseau horaire de l'heure de EST (Montreal/Canada) on peut faire:

ln -s /usr/share/zoneinfo/EST /etc/localtime
# ou encore
ln -s /usr/share/zoneinfo/America/Montreal /etc/localtime

Quelle heure est-il à ?

$ find /usr/share/zoneinfo/ -iname "*israel*"
/usr/share/zoneinfo/right/Israel
/usr/share/zoneinfo/posix/Israel
/usr/share/zoneinfo/Israel

$ date
vendredi 14 décembre 2018, 09:07:50 (UTC+0100)

$ TZ=Israel date
vendredi 14 décembre 2018, 10:08:16 (UTC+0200)
2025/03/24 15:06

Notes FTP Pure-FTPd

Voir aussi :

Installation

apt-get install pure-ftpd

N'autoriser que les utilisateurs présents dans /etc/ftpallow

/etc/pam.d/pure-ftpd
# Uncomment next line to allow non-anonymous ftp access ONLY for users,
# listed in /etc/ftpallow
auth    required        pam_listfile.so item=user sense=allow file=/etc/ftpallow onerr=fail
/etc/ftpallow
# list of users ALLOWED non-anonymous FTP access.
# You must edit the pam config in /etc/pam.d/pure-ftpd for this to take effect.
ftpuser

On chroot tous les utilisateurs

echo yes > /etc/pure-ftpd/conf/ChrootEveryone
service pure-ftpd restart
2025/03/24 15:06

Notes FTP ProFTPd

Voir aussi :

Debian

apt-get install proftpd-basic

RedHat

yum install proftpd proftpd-utils 

RedHat

/etc/sysconfig/proftpd

#PROFTPD_OPTIONS=""
PROFTPD_OPTIONS="-DTLS -DDYNAMIC_BAN_LISTS"

/etc/proftpd/proftpd.conf

UseIPv6                         off
UseReverseDNS                   off
ServerType                      standalone
DefaultRoot                     ~

AuthPAM                         off
#AuthOrder                      mod_auth_pam.c* mod_auth_unix.c
AuthOrder                       mod_auth_file.c

FTPS passif

/etc/proftpd.conf

MasqueradeAddress     55.128.131.215

# ServerName                    "ProFTPD server"
ServerName                    "ftp.acme.fr"

SystemLog /var/log/proftpd/proftpd.log
TransferLog /var/log/proftpd/xferlog

TLSRSACertificateFile               /etc/pki/tls/certs/wildcard.acme.fr.cer
TLSRSACertificateKeyFile            /etc/pki/tls/certs/wildcard.acme.fr.key

#   TLSOptions                  NoCertRequest                                                      
    TLSOptions                  NoCertRequest NoSessionReuseRequired

    PassivePorts 40000 40200

#   BanOnEvent                  MaxLoginAttempts 2/00:10:00 01:00:00                          
    BanOnEvent                  MaxLoginAttempts 5/00:10:00 01:00:00

/etc/shells

/bin/false
ftpasswd --passwd --name=ftpuser --uid=$(id -u linuxuser) --gid=$(id -g linuxuser) --home=/home/ftp --shell=/bin/false --file=/etc/proftpd/ftpd.passwd
ftpasswd --group  --name=ftpuser --gid=$(id -g linuxuser) --file=/etc/proftpd/ftpd.group --member=ftpuser

/etc/proftpd/conf.d/plop.conf

AuthUserFile /etc/proftpd/ftpd.passwd
AuthGroupFile /etc/proftpd/ftpd.group
UseFtpUsers on
 
<Directory />
  HideFiles (lost\+found|welcome\.msg|\.message|^\..*)
  <Limit ALL>
        IgnoreHidden            on
  </Limit>
</Directory>

Validate - check syntax

#proftpd -td10
proftpd -td10 -c /etc/proftpd.conf

Lancer & activer le service

systemctl start proftpd.service
systemctl enable proftpd.service

Autres Liste des modules

proftpd -l
proftpd -V
proftpd -vv
proftpd -nd6

Test TLS/SSL

openssl s_client -connect 192.0.2.10:21 -starttls ftp

Pb

Pb error: no valid servers configured
journalctl -xe
Aug 10 14:36:11 acme proftpd[1331]: Starting ftp server: proftpd2017-08-10 14:36:11,019 acme proftpd[1338]: warning: unable to determine IP address of 'acme'
Aug 10 14:36:11 acme proftpd[1331]: 2017-08-10 14:36:11,019 acme proftpd[1338]: error: no valid servers configured
Aug 10 14:36:11 acme proftpd[1331]: 2017-08-10 14:36:11,020 acme proftpd[1338]: fatal: error processing configuration file '/etc/proftpd/proftpd.conf'

Cela peut arriver à la suite d'un changement de hostname

hostname -i
hostname: Temporary failure in name resolution
Solution

Le hostname doit être résolvable

echo "127.0.1.1       $(hostname -s).localdomain     $(hostname -f)" >> /etc/hosts

/etc/hosts

127.0.0.1       localhost
127.0.1.1       acme.localdomain      acme

Autre solution /etc/proftpd/proftpd.conf

DefaultAddress 127.0.0.1
sed -i -e 's/^LoadModule mod_unique_id.c/#&/' /etc/proftpd/modules.conf
2025/03/24 15:06

Notes formatage mkfs mount file system

XFS

# ls -l /dev/mapper/|grep part|awk '{print $9}'
3624a937043be47c12334399b00016d73-part1
3624a937043be47c12334399b00016d74-part1
3624a937043be47c12334399b00016d75-part1
# parts=`ls -l /dev/mapper/|grep part|awk '{print $9}'`
# for i in $parts
> do
> mkfs.xfs -d su=131072,sw=8 -i size=1024 $i
> done

You can verify that the underlying filesystem has the correct values for stripe unit and stripe width by using the xfs_info command:

mount -t xfs -o nobarrier,noatime,nodiratime,inode64 /dev/mapper/3624a937043be47c12334399b00016d73-part1 /disk1
# xfs_info /disk1
meta-data=/dev/mapper/3624a937043be47c12334399b00016d73-part1 isize=1024   agcount=4, agsize=83623808 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=334495232, imaxpct=5
         =                       sunit=32     swidth=256 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=163328, version=2
         =                       sectsz=512   sunit=32 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

sunit and swidth are shown in bsize (block size) units in the xfs_info command output.

stripe unit= 32 sunits * 4096 bsize (block size)= 131072 bytes = 128K
stripe width= 256 blocks * 4096 bsize = 1M = 128K * 8 drives

The sysctl fs.xfs.rotorstep can be used to change how many files are put into an XFS allocation group. Increasing the default number from 1 to 255 reduces seeks to multiple allocation groups. Improved performance has been observed in some cases by increasing this number. You can put the following line in /etc/sysctl.conf to ensure this change is affected on each boot of the system:

fs.xfs.rotorstep = 255

When mounting the XFS filesystem that resides on the LUNs offered from the FlashArray, be sure to use the following mount options:

mount –t xfs –o “discard,nobarrier,noatime,nodiratime,inode64” \
/dev/mapper/nodeX /srv/node/sdb1

Source : https://pure-storage-openstack-docs.readthedocs.io/en/wallaby/swift/section_swift-partitioning.html

The overlay2 driver is supported on xfs backing filesystems, but only with d_type=true enabled.

Autres /mkfs.xfs -m reflink=1 /dev/sdc

mkfs.xfs -n ftype=1 -m reflink=1 /dev/mapper/vg_data-data
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki