1. 概要
「vim」は、インストール済でした。
この手のものは、端末から、「root」ユーザのコマンドでインストールするのが手っ取り早いのです。
2. sshd
あらかじめインストールされています。
有効化して、起動します。
「root」ユーザ権限で。
systemctl enable sshd
systemctl start sshd
ファイアウォールのポートは、デフォルトで開放されておりました。
3. インストール
以降の作業で、端末上での作業中にコピペするのに不自由なので、ブラケットペーストモードをオフにしておきます。
(詳細は、「シェル - bash」の「ブラケットペーストモード」の項をご参照ください)
「root」ユーザ権限で。
vi /etc/inputrc
下記の1行を末尾に加えます。
set enable-bracketed-paste off
パッケージの更新。
dnf update -y
アップグレード。
dnf upgrade
必要な、ツール等をインストールします。
(「vsftpd」は失敗したので、後で)
dnf install -y krb5-appl-clients rcs vim vsftpd
4. vim
以下は、すべてのユーザで。
「vim」に以下の設定を行います。
・行番号を表示
・ビジュアルモードを無効
・オートインデントを有効に
「bash」に以下の設定を行います。
・/sbin にパスが通っていないので、追加
・ls のデフォルトをドットファイル・カラー表示を基本に
・上下の矢印キーでコマンド履歴の補完
mkdir -pv ~/.vim/after/indent
mkdir -pv ~/.vim/after/plugin
touch ~/.vim/after/indent/vim.vim
sh
cat << 'EOF' >> ~/.vim/after/indent/vim.vim
set number
set mouse-=a
set autoindent
EOF
exit
cp ~/.vim/after/indent/vim.vim ~/.vim/after/plugin/.
sh
cat << 'EOF' >> ~/.bashrc
export PATH="$PATH":/sbin
alias ci='ci -l'
alias co='co -l'
alias ls='ls -a --color'
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
export PS1='\u@\h $PWD > '
EOF
exit
source ~/.bashrc
5. フォント
必要なパッケージをインストールしてから、フォントをインストールします。
「root」ユーザ権限で。
dnf install -y dpkg diffutils gnutar
「MigMix」のダウンロード・インストール。
curl http://archive.ubuntu.com/ubuntu/pool/universe/f/fonts-migmix/fonts-migmix_20200307-1_all.deb --output /tmp/fonts-migmix_20200307-1_all.deb
dpkg -i /tmp/fonts-migmix_20200307-1_all.deb
6. vsftpd
コンフィグレーションファイルを編集します。
以下、「root」ユーザ権限で。
vi /etc/vsftpd/vsftpd.conf
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
#local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
#write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022
「anonymou」ユーザのログインを禁止、ローカルユーザのログインを許可、書込み許可を設定、書き込み時の権限を設定します。
12行目をコメントアウトします。
15、18、22行目を有効にします。
ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=NO
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
# Make sure, that one of the listen options is commented !!
listen_ipv6=YES
ユーザからディレクトリが見られるようにします。
108行目をコメントアウトします。
「IpV6」を無効に「IPv4」を有効にします。
116行目を「YES」に、112行目を「NO」にします。
ログインユーザから、書き込みができるように、末尾に以下の2行を追加します。
seccomp_sandbox=NO
allow_writeable_chroot=YES
どうも、「pam」の設定がおかしいようで、ログインできません。
パスワードを入力したところで、「530 login incorrect」になってしまいます。
設定を変更します。
vi /etc/pam.d/vsftpd
#%PAM-1.0
auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth required /lib/security/pam_shells.so
auth include system-auth
account include system-auth
session include system-auth
すべてコメントアウトして、末尾に下記を加えます。
auth required pam_listfile.so item=user sense=deny file=/etc/ssh/denyusers
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
session include system-auth
これは、「/etc/pam.d/sshd」をぱくりました。
つまり、「sshd」にログインできるユーザは、「ftpd」にログインできることになります。これが一番、無難であると判断しました。
ファイアウォールが閉じているので、「ftp」のポートを開きます。
「OpenMandriva Control Centor」から設定しようとしましたが、どうもうまく設定できない。
結局のところ、コマンドで設定するのが、一番手っ取り早い。
firewall-cmd --add-service=ftp --zone=public --permanent
firewall-cmd --reload
上記までの設定が終わったら、「ftpd」を有効にして起動します。
systemctl enable vsftpd
systemctl start vsftpd