2013年3月14日木曜日

debian

debianがあぼんしたので再インストールのメモ


やらかしました。
ターミナル開くとずーっと
y
y
y
y
y
y
y
y
y
y
y
y
y
y
リスタートしても
y
y
y
y
y
y
y
y
y


よくわからんので再インストール

CDぶち込み再インストールをかけました。

sshはデフォルトでインストール
それ以外は何もしてません。



#■ソフトウェア(パッケージ)一覧情報の更新をする。ソフトウェアの一覧情報の更新だけあって、ソフトウェアそのものの更新はしない。
aptitude update


#■このコマンドはなるべく多くのパッケージを更新します。依存関係に問題がある場合は、(例えばそれらを削除したりはせずに) パッケージの更新を行いません。
aptitude upgrade

#■ユーザー作成
adduser hogehoge(ユーザー名)

#■作成したuserのpasswdを決める。決める?入力する?決定する?
passwd hogehoge

#■作成したユーザの詳細確認?
grep hogehoge /etc/passwd


#■sudoのインストール
apt-get install sudo

#■vimのインストール
apt-get install vim


vim /etc/network/interfaces

<<参考>>
http://www.logos.ic.i.u-tokyo.ac.jp/~s1s5/pukiwiki/index.php?Linux%2F%B4%C9%CD%FD%BC%D4%A4%E0%A4%B1%2F%A4%E2%A4%ED%A4%E2%A4%ED%A4%CE%C0%DF%C4%EA#raa745d4
参考にするといいかも

>>内容
-------------------------------------------------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

##---------------- START
auto eth0
iface eth0 inet static
address 192.168.0.5←debianに設定するip
netmask 255.255.255.0
gateway 192.168.0.●←
##---------------- END

↓コメントアウト
# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
-------------------------------------------------------------
#■リスタート
/etc/init.d/networking restart


#■sudoの設定-ものによってnano editが起動する。
visudo

内容
--------------------------------------------------------------------
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults        env_reset
# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL

hogehoge  ALL=(ALL) ALL
↑adduserしたユーザ名
ALL=(ALL) ALLに関しては色々書き方があるっぽいど


# Allow members of group sudo to execute any command
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d
--------------------------------------------------------------------


#■sshの設定
バックアップをとる
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.default



sshの設定を編集する
ここではまだ色々済んでいないので後日設定
sudo /etc/init.d/ssh stop←sshを一応止める
vim /etc/ssh/sshd_config

#■hostsの設定
vim /etc/hosts.allow


<<参考>>
http://www.itmedia.co.jp/help/tips/linux/l0124.html
↓hostsでできること
1. アクセス元の条件を決める
hosts.allow,hosts.denyファイルでは,IPやドメインを指定してアクセス元を限定することができる。
2. どのサービスを起動許可するかを決める
デーモン起動以外のinetサービスでは,inetdでサービスの起動許可を設定する。
3. TCP,UDPごとのフィルタ設定を行う
 tcp wrapperなどによって,特定のポート番号でのアクセスを制限する。一般的にファイアウォールと呼ばれるアクセス制限の手段。

 ここでは,1番の/etc/hosts.allow,/etc/hosts.denyの記述例を挙げてみよう。

・hosts.allow
 アクセス許可条件を設定するファイル
・hosts.deny
 アクセス不可条件を設定するファイル

 2つのファイル共に,基本的に次のような記述フォーマットになっている。


sudo /etc/init.d/networking restart



一応これでターミナルにアクセスできるだろう。
腰が痛かった

0 件のコメント :

コメントを投稿