検索条件
全9件
(2/2ページ)
$ cat >> .profile << EOF export PS1='\n\[\e[1;32m\e[44m\]\D{%F %T}\[\e[0m\] [ \[\e[1;33m\e[44m\] \w \[\e[0m\] ]\n\[\e[1;31m\e[44m\]\u\[\e[0m\] @ \[\e[1;33m\e[42m\]\h\[\e[0m\] \[\e[1;34m\][\!]\$\[\e[0m\] ' export TMOUT=3000 export HISTSIZE=1000000 export HISTFILE=$HOME/.history export HISTCONTROL=ignoredups EOFPS1 はプロンプトの設定をしている。
export PS1='\n\D{%F %T} [ \w ]\n\u @ \h [\!]\$ 'TMOUT=3000 はプロンプトの状態で3000秒放置すると自動でログアウトする。
$ . ~/.profile
OpenBSD-PINE64# date201910022000
OpenBSD-PINE64# echo "ntpd_flags=\"-s\"" >> /etc/rc.conf.localこれでntpdデーモンが時間を合わせてくれる。
OpenBSD-PINE64$ cat /etc/ntpd.conf # $OpenBSD: ntpd.conf,v 1.14 2015/07/15 20:28:37 ajacoutot Exp $ # # See ntpd.conf(5) and /etc/examples/ntpd.conf servers pool.ntp.org sensor * constraints from "https://www.google.com"この設定だと pool.ntp.org に接続して時間をとってくる。
OpenBSD-PINE64$ grep ntpd /var/log/daemon
OpenBSD-PINE64# head -n1 /etc/group wheel:*:0:root,bsduser
OpenBSD-PINE64# cat >> /etc/doas.conf << EOF > permit bsduser > EOF次のように記述すればパスワードの入力をしないようにも設定できる。
OpenBSD-PINE64$ file `which adduser` /usr/sbin/adduser: a /usr/bin/perl script text executable OpenBSD-PINE64$ file `which useradd` /usr/sbin/useradd: ELF 64-bit LSB shared object, AArch64, version 1
OpenBSD-PINE64# adduser Use option ``-silent'' if you don't want to see all warnings and questions. Reading /etc/shells Check /etc/master.passwd Check /etc/group Ok, let's go. Don't worry about mistakes. There will be a chance later to correct any input. Enter username []: bsduser Enter full name []: Enter shell csh ksh nologin sh [ksh]: Uid [1001]: Login group bsduser [bsduser]: Login group is ``bsduser''. Invite bsduser into other groups: guest no [no]: Login class authpf bgpd daemon default pbuild staff unbound [default]: Enter password []: Enter password again []: Name: bsduser Password: **** Fullname: bsduser Uid: 1001 Gid: 1001 (bsduser) Groups: bsduser Login Class: default HOME: /home/bsduser Shell: /bin/ksh OK? (y/n) [y]:
OpenBSD-PINE64# useradd bsduser useradd: Warning: home directory `/home/bsduser' doesn't exist, and -m was not specified OpenBSD-PINE64# id bsduser uid=1001(bsduser) gid=1001(bsduser) groups=1001(bsduser)/home/bsduser ディレクトリがないことを注意されたので作成しておく。
OpenBSD-PINE64# mkdir /home/bsduser作ったホームディレクトリの所有者を変更する。
OpenBSD-PINE64# ls -lF /home/ drwxr-xr-x 2 root wheel 512 Apr 21 04:12 bsduser/ OpenBSD-PINE64# chown bsduser:bsduser /home/bsduser/ OpenBSD-PINE64# ls -lF /home/ drwxr-xr-x 2 bsduser bsduser 512 Apr 21 04:12 bsduser/パスワードの設定をする。
OpenBSD-PINE64# passwd bsduser Changing password for bsduser. New password: Retype new password:弱いパスワードだと注意される。
OpenBSD-PINE64# passwd bsduser Changing password for bsduser. New password: Please don't use an all-lower case password. Please use a different password. Unusual capitalization, control characters, or digits are suggested. New password:
OpenBSD-PINE64# ls -alF /etc/skel/ total 36 drwxr-xr-x 3 root wheel 512 Apr 17 21:16 ./ drwxr-xr-x 22 root wheel 1536 Apr 21 04:20 ../ -rw-r--r-- 1 root wheel 87 Apr 17 20:25 .Xdefaults -rw-r--r-- 1 root wheel 771 Apr 17 20:25 .cshrc -rw-r--r-- 1 root wheel 101 Apr 17 20:25 .cvsrc -rw-r--r-- 1 root wheel 359 Apr 17 20:25 .login -rw-r--r-- 1 root wheel 175 Apr 17 20:25 .mailrc -rw-r--r-- 1 root wheel 215 Apr 17 20:25 .profile drwx------ 2 root wheel 512 Apr 17 21:16 .ssh/ OpenBSD-PINE64# ls -alF /etc/skel/.ssh/ total 8 drwx------ 2 root wheel 512 Apr 17 21:16 ./ drwxr-xr-x 3 root wheel 512 Apr 17 21:16 ../ -rw------- 1 root wheel 0 Apr 17 20:25 authorized_keys OpenBSD-PINE64# cp -r /etc/skel/.* /home/bsduser/ OpenBSD-PINE64# chown -R bsduser /home/bsduser/.* OpenBSD-PINE64# ls -alF /home/bsduser/ total 36 drwxr-xr-x 3 bsduser bsduser 512 Apr 21 04:25 ./ drwxr-xr-x 4 root wheel 512 Apr 21 04:12 ../ -rw-r--r-- 1 bsduser bsduser 87 Apr 21 04:25 .Xdefaults -rw-r--r-- 1 bsduser bsduser 771 Apr 21 04:25 .cshrc -rw-r--r-- 1 bsduser bsduser 101 Apr 21 04:25 .cvsrc -rw-r--r-- 1 bsduser bsduser 359 Apr 21 04:25 .login -rw-r--r-- 1 bsduser bsduser 175 Apr 21 04:25 .mailrc -rw-r--r-- 1 bsduser bsduser 215 Apr 21 04:25 .profile drwx------ 2 bsduser bsduser 512 Apr 21 04:25 .ssh/ OpenBSD-PINE64# ls -alF /home/bsduser/.ssh/ total 8 drwx------ 2 bsduser bsduser 512 Apr 21 04:25 ./ drwxr-xr-x 3 bsduser bsduser 512 Apr 21 04:25 ../ -rw------- 1 bsduser bsduser 0 Apr 21 04:25 authorized_keys