« 2017年03月 | メイン | 2017年05月 »

2017年04月20日

iptable現状確認&保存

iptables-save > /etc/sysconfig/iptables

投稿者 muuming : 12:04

2017年04月14日

centos7 vmware

no suitable device found for this connection

とエラーでるなら

ifcfgファイルに

NM_CONTROLLED=”no”

を追記っと

networkマネージャってのが7からあるらしいがこれに管理させるとおかしなことになるようなならないような。

投稿者 muuming : 14:54

2017年04月12日

いまさらだけど、postgresユーザー

管理者が意図していない権限のテーブルにアクセスできてしまう。
そこでこれらの権限を削除する必要がある。

REVOKE CONNECT ON DATABASE データベース名 FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM PUBLIC;

ユーザー追加
su - postgres
createuser -D -E -R -S -P username

createdb dbname

pg_hba.conf
host all all 127.0.0.1/32 md5

-- 1. まずすべての権限を削除しているので、データベースへの接続権限を付ける必要がある。
GRANT CONNECT ON DATABASE データベース名 TO ユーザ名;

-- 2. スキーマに対してアクセス権限を付ける。
GRANT USAGE ON SCHEMA スキーマ名 TO ユーザ名;

-- 3. 特定のテーブルに対して(主な権限は{ CRUDの4つ | TRUNCATE | ALL })
GRANT 権限名 ON テーブル名 TO ユーザ名

ユーザー落とし
dropuser username

投稿者 muuming : 13:23

2017年04月10日

centos7使い始めるよ

時代遅れのむーさんは今頃centos7に乗り換えてるのであった。

0,足りない物入れ
yum groupinstall "Development Tools"
yum install rpm-build

lvも
rpmbuild --rebuild lv-4.51-25.el7.src.rpm
yum install /mydir/rpmbuild/RPMS/x86_64/lv-4.51-25.el7.centos.x86_64.rpm

 

Selinuxの確認 わたしゃ使い切らんので切る。
/etc/selinux/config
SELINUX=disabled

firewall関連
firewalldってのが基本使われるらしいのですが、わからないのでポイ
使い慣れた(ってそんなに使わないけどw)iptablesでお願いします。

[root@localhost ~]# systemctl list-unit-files | grep firewalld
firewalld.service enabled

有効に成ってるねぇ。
systemctl disable firewalld.service
systemctl stop firewalld

yum -y install iptables-services
systemctl enable iptables.service
systemctl start iptables.service

ごにょごにょ iptablesいじってその状態で保存したいなら
iptables-save > /etc/sysconfig/iptables

 

1,サービスの起動方法
/etc/init.d/httpd start

 からの

systemctl start unit名
systemctl stop unit名
systemctl restart unit名

systemctl kill unit名

要はhttpd なら  systemctl start httpd
だがしかし、configtestはまた違うw
service httpd configtest まとめてくれよ・・・

2,unit名はタブ補完効かない!
ls -al /usr/lib/systemd/system/|grep service
このあたりか?

yum install bash-completion すれば補完効くんだって
ただし反応超鈍い・・・

3,電源投入時の起動設定
chkconfig --list
systemctl list-unit-files

chkconfig httpd on
systemctl enable httpd

chkconfig httpd off
systemctl disable httpd

やってることは
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
的なシンボリックリンクを貼る作業

4,postgresスタートしないぞ
Job for postgresql.service failed because the control process exited with error code. See "systemctl status postgresql.service" and "journalctl -xe" for details.

初期化忘れだね。
su - postgres
initdb

投稿者 muuming : 10:11