Beginning with hardened gentoo. 08-26-2015, 02:24 AM
#1
First start with
----------------------------------
partitions
----------------------------------
fdisk -l
cfdisk /dev/sda make /dev/sda1 swap /dev/sda2 boot linux
mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt/gentoo
mkswap /dev/sda1
swapon /dev/sda1
cd /mnt/gentoo
-----------------------------------
Getting file's that is needed
-----------------------------------
links http://www.gentoo.org/main/en/mirrors.xml(Find the stage 3 and the portage latest)
tar -xjpf the stage
tar -xvjf the portage -C usr/
-----------------------------------
Putting things in places and mounting.
------------------------------------
cp -L /etc/resolv.conf /mnt/gentoo/etc
mount -t proc non /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
chroot . /bin/bash
-----------------------------------
Getting shit
-----------------------------------
env-update
source /etc/profile
export PS1="(chroot) $PS1"
emerge --sync
eselect profile list ( I just choose the 3 so it would be )
eselect profile set 3
eselect profile list
----------------------------------
Configing Shit
----------------------------------
nano -w /etc/portage/make.conf(Then in the config file go down to the the USE="mmx sse sse2, and add this USE="$USE alsa openbox -gtk3" optional make's shit easier later)
cp /usr/share/zoneinfo/US/Eastern /etc/localtime
echo "US/Eastern" > /etc/timezone
----------------------------------
Getting the kernel
emerge gentoo-sources
emerge genkernel
genkernel all
---------------------------------
---------------------------------
More Configing shit
---------------------------------
nano -w /etc/conf.d/modules(then go in the config file for the modules and find the 4th modules and change it from "ohci394" to "iwlwifi" )
nano -w /etc/fstab
in the config for fstab gentoo does not generate it, with you're hardrive mount's
in place so you have to say where it goes so take out
<fs> <mountpoint> <type> <opts> <dump/pass>
/dev/BOOT /boot ext2 noauto,noatime 1 12
/dev/fd0 /mnt/floppy auto noauto 0 0
then change
/dev/ROOT / ext3 noatime 0 1
/dev/swap none swap sw 0 0
to
/dev/sda2 / ext4 noatime 0 1
/dev/sda1 none swap sw 0 0
nano -w /etc/conf.d/hostname (Make you're hostname whatever you want)
nano -w /etc/hosts (on 127.0.0.1 localhost add you're hostname so example
127.0.0.1 dolly localhost , dolly being the hostname)
hostname dolly
hostname -f
nano /etc/locale.gen (add uncomment you're language then do ctrl +o and ctrl + x)
locale-gen
------------------------------------------------------------------
Basic thing's (raw materials of gentoo for it to work)
------------------------------------------------------------------
emerge dhcpcd
passwd (change you're root pass, lol.)
-----------------------------------------------------------------
Bootloader time
-----------------------------------------------------------------
emerge grub(wait the gay time for it to compile everything you must compile it's gentoo
when it's done compiling do)
grub2-install --force /dev/sda
grub2-mkconfig -o /boot/grub/grub.cfg
exit
reboot
(Now you have gentoo and you can load it from the grub, the next is for if you are going to use a gui but if not then this same setup is technically what a server is)
----------------------------------------------------------------
Xorg time with openbox, I choose the most lighest shit so
if you like to have bloated shit, then use other shit I guess
----------------------------------------------------------------
emerge --ask x11-base/xorg-server (It will not compile yet you have to do some bs and do this)
etc-update (when you are there is tells you do you have options and don't do certain shit just type -3, and after re do the command , once it's compiled you have xorg however gui will not work yet.)
emerge --ask xinit(Do the same -3 in etc-update)
emerge --ask openbox(this is the windows manager take's some time)
emerge --ask x11-terms/xfce4-terminal (Do the same -3 in etc-update)
etc-upate and do the same thing with -3
emerge firefox
emerge ntfs3g (option if you have a hardrive for other shit that you want to mount it's a nice little command line tool for it)
emerge udevil(for usb stick's and anything else you plug into you're computer)
emerge vim
emerge sudo(doesn't have sudo so compile it lol)
useradd -m -G users,audio,video /bin/bash molly (or whatever name you want)
passwd molly (you're name)
vim /etc/sudoers and add yourself to it for the sudo shit
now do su molly (or whatever you're name is )
cd
vim .xinitrc(create that file and add this to it)
exec openbox-session
then save the file
now reboot
login with you're user type startx
At this point you are on you're own.
Extra shit I personally compile myself.
emerge feh(let's you have a wallpaper)
emerge ncmpcpp
emerge mpd
emerge mpc(it's really fucking cool lets you add a bunch of music with mpc add rap-music and clear it with mpc-clear)
emerge pidgin
emerge pidgin-otr
emerge pidgin-musictracker
emerge pidgin-gpg
emerge mumble
And then some forensic's programs, for customization If you reallly want
I can give you my .mpd .ncmpcpp .config .vim .vim_runtime file's
Hopefully helped some people out with the whole 'hardened gentoo is a bitch' thing.
----------------------------------
partitions
----------------------------------
fdisk -l
cfdisk /dev/sda make /dev/sda1 swap /dev/sda2 boot linux
mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt/gentoo
mkswap /dev/sda1
swapon /dev/sda1
cd /mnt/gentoo
-----------------------------------
Getting file's that is needed
-----------------------------------
links http://www.gentoo.org/main/en/mirrors.xml(Find the stage 3 and the portage latest)
tar -xjpf the stage
tar -xvjf the portage -C usr/
-----------------------------------
Putting things in places and mounting.
------------------------------------
cp -L /etc/resolv.conf /mnt/gentoo/etc
mount -t proc non /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
chroot . /bin/bash
-----------------------------------
Getting shit
-----------------------------------
env-update
source /etc/profile
export PS1="(chroot) $PS1"
emerge --sync
eselect profile list ( I just choose the 3 so it would be )
eselect profile set 3
eselect profile list
----------------------------------
Configing Shit
----------------------------------
nano -w /etc/portage/make.conf(Then in the config file go down to the the USE="mmx sse sse2, and add this USE="$USE alsa openbox -gtk3" optional make's shit easier later)
cp /usr/share/zoneinfo/US/Eastern /etc/localtime
echo "US/Eastern" > /etc/timezone
----------------------------------
Getting the kernel
emerge gentoo-sources
emerge genkernel
genkernel all
---------------------------------
---------------------------------
More Configing shit
---------------------------------
nano -w /etc/conf.d/modules(then go in the config file for the modules and find the 4th modules and change it from "ohci394" to "iwlwifi" )
nano -w /etc/fstab
in the config for fstab gentoo does not generate it, with you're hardrive mount's
in place so you have to say where it goes so take out
<fs> <mountpoint> <type> <opts> <dump/pass>
/dev/BOOT /boot ext2 noauto,noatime 1 12
/dev/fd0 /mnt/floppy auto noauto 0 0
then change
/dev/ROOT / ext3 noatime 0 1
/dev/swap none swap sw 0 0
to
/dev/sda2 / ext4 noatime 0 1
/dev/sda1 none swap sw 0 0
nano -w /etc/conf.d/hostname (Make you're hostname whatever you want)
nano -w /etc/hosts (on 127.0.0.1 localhost add you're hostname so example
127.0.0.1 dolly localhost , dolly being the hostname)
hostname dolly
hostname -f
nano /etc/locale.gen (add uncomment you're language then do ctrl +o and ctrl + x)
locale-gen
------------------------------------------------------------------
Basic thing's (raw materials of gentoo for it to work)
------------------------------------------------------------------
emerge dhcpcd
passwd (change you're root pass, lol.)
-----------------------------------------------------------------
Bootloader time
-----------------------------------------------------------------
emerge grub(wait the gay time for it to compile everything you must compile it's gentoo
when it's done compiling do)grub2-install --force /dev/sda
grub2-mkconfig -o /boot/grub/grub.cfg
exit
reboot
(Now you have gentoo and you can load it from the grub, the next is for if you are going to use a gui but if not then this same setup is technically what a server is)
----------------------------------------------------------------
Xorg time with openbox, I choose the most lighest shit so
if you like to have bloated shit, then use other shit I guess
----------------------------------------------------------------
emerge --ask x11-base/xorg-server (It will not compile yet you have to do some bs and do this)
etc-update (when you are there is tells you do you have options and don't do certain shit just type -3, and after re do the command , once it's compiled you have xorg however gui will not work yet.)
emerge --ask xinit(Do the same -3 in etc-update)
emerge --ask openbox(this is the windows manager take's some time)
emerge --ask x11-terms/xfce4-terminal (Do the same -3 in etc-update)
etc-upate and do the same thing with -3
emerge firefox
emerge ntfs3g (option if you have a hardrive for other shit that you want to mount it's a nice little command line tool for it)
emerge udevil(for usb stick's and anything else you plug into you're computer)
emerge vim
emerge sudo(doesn't have sudo so compile it lol)
useradd -m -G users,audio,video /bin/bash molly (or whatever name you want)
passwd molly (you're name)
vim /etc/sudoers and add yourself to it for the sudo shit
now do su molly (or whatever you're name is )
cd
vim .xinitrc(create that file and add this to it)
exec openbox-session
then save the file
now reboot
login with you're user type startx
At this point you are on you're own.
Extra shit I personally compile myself.
emerge feh(let's you have a wallpaper)
emerge ncmpcpp
emerge mpd
emerge mpc(it's really fucking cool lets you add a bunch of music with mpc add rap-music and clear it with mpc-clear)
emerge pidgin
emerge pidgin-otr
emerge pidgin-musictracker
emerge pidgin-gpg
emerge mumble
And then some forensic's programs, for customization If you reallly want
I can give you my .mpd .ncmpcpp .config .vim .vim_runtime file's
Hopefully helped some people out with the whole 'hardened gentoo is a bitch' thing.


![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)













