1. 概要
「vim」は、インストール済でした。
この手のものは、端末から、「root」ユーザのコマンドでインストールするのが手っ取り早いのですが、「4.0」で、「urpmi」がうまく動作しなかったので、後述する「dnfdoragora」でインストールします。
2. vim
「行番号を表示」「ビジュアルモードを無効」という設定にします。
mkdir -pv ~/.vim/after/indent
mkdir -pv ~/.vim/after/plugin
touch ~/.vim/after/indent/vim.vim
cat - << EOF >> ~/.vim/after/indent/vim.vim
set number
set mouse-=a
EOF
cp ~/.vim/after/indent/vim.vim ~/.vim/after/plugin/.
vim の設定を含め、bash の設定をカスタマイズします。
末尾に以下を記述して、下記の設定を行います。
・/sbin にパスが通っていないので、追加
・ls のデフォルトをドットファイル・カラー表示を基本に
・上下の矢印キーでコマンド履歴の補完
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
source ~/.bashrc
3. sshd
あらかじめインストールされています。
確か、「4.0」では、「service」コマンドが動作したのですが、今回、「systemctl」でないとうまく機能してくれません。
有効化して、起動します。
「root」ユーザで
systemctl enable sshd
systemctl start sshd
ファイアウォールのポートは、デフォルトで開放されておりました。
4. rcs
「rcs」は、インストールするだけで、使えます。
5. ftpd
「Dnfdragora」にパッケージは見えて、インストールに成功したように見えるのですが、実体が入っていない・・・。
「4.0」のパッケージをダウンロードして、インストールしてみます。
curl http://abf-downloads.openmandriva.org/4.0/repository/x86_64/main/release/vsftpd-3.0.3-3-omv4000.x86_64.rpm --output /tmp/vsftpd-3.0.3-3-omv4000.x86_64.rpm
「rpm」コマンドでインストールしようとするとエラーになります。
「discover」でインストールするのも失敗します。
「vsftpd-3.0.3-3-omv4000.x86_64.rpm」をファイルマネージャ経由で、「dnfdragora」で開いてインストールします。
コンフィグレーションファイルを編集
vi /etc/vsftpd/vsftpd.conf
「anonymous」接続禁止、ログインユーザの接続を許可して、書き込み可、IPv4 で接続を設定します。
# 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
を下記へ変更します。
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# 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
# 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
を下記へ変更します。
# 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=YES
#
# 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=NO
末尾に、2行追加します(そうしないと、クライアントから「ls」が機能しない)。
seccomp_sandbox=NO
allow_writeable_chroot=YES
一時的に起動するには
$ service vsftpd start
Starting vsftpd (via systemctl): [ OK ]
「sshd」と同様、一時的に有効にしているだけで、恒久的に有効化する方法は、わかりません。
また、本節の「ファイアウォール」の設定を行わないとクライアントからの接続はできません。