[Info] Setting up a new Gentoo Linux box

Setting up a new Gentoo Linux box

 

  1. Setting the editor to vim
    • emerge -av app-editors/vim
    • eselect editor list
    • eselect editor set 2
  2. Setting the hostname
    • vi /etc/conf.d/hostname
  3. Set the IP address
    • vi /etc/conf.d/net
  4. Set the root password
    • passwd root
  5. Set the timezone
    • ls /usr/share/zoneinfo
    • echo "America/Toronto" > /etc/timezone
    • emerge --config sys-libs/timezone-data
  6. Install NTP client (optional)
    • emerge -av net-misc/ntp
  7. Configure the locales
    • vi /etc/locale.gen
      • en_US ISO-8859-1
      • en_US.UTF-8 UTF-8
      • de_DE ISO-8859-1
      • de_DE@euro ISO-8859-15
    • locale-gen
    • locale-a
    • eselect locale list
    • eselect locale set 10  # or run:
    • eselect locale set $(eselect locale list | grep en_US.utf8 | cut -d’]’ -f1 | cut -d’[’ -f2)
  8. Select the right profile
    • eselect profile list
    • eselect profile set 3
  9. New user setup
    • useradd marcus -g wheel   # create new user and add it to wheel group
    • gpasswd -a marcus cron     # add the user ’marcus’ to cron group so he can schedule tasks
  10. Sudo setup
    • emerge -av app-admin/sudo
    • visudo   # examples
      • marcus localhost = /usr/bin/emerge, /usr/bin/ebuild, /usr/sbin/emerge-webrsync   # to allow user ’marcus’ run these commands on local host
      • %wheel localhost = /usr/bin/emerge
      • larry ALL = /usr/bin/emerge                          # allow the user larry to execute the emerge command as root, regardless of where he is logged in from
      • Cmnd_Alias KILL = /bin/kill, /usr/bin/pkill
      • larry ALL = (apache, gorg) KILL                      # allow larry to run the kill tool as the apache or gorg user
  11. Crontab setup
    • emerge -av dcron
    • /etc/init.d/dcron start
    • rc-update add dcron default
    • gpasswd -a marcus cron     # add the user ’marcus’ to cron group so he can schedule tasks
    • crontab -e    # add new commands to cron
    • crontab -l     # list existing commands in cron
    • crontab -d    # delete existing crontab jobs
  12. Set aliases for useful commands (add these for any user you want)
    • echo -e "alias ll=\"ls -l\"" >> ~/.bashrc
    • echo -e "alias lla=\"ls -la\"" >> ~/.bashrc
    • Note: if ~/.bashrc doesn’t exist, the user wasn’t probably created with "-m" (--make-home) flag to the useradd command
    • so you may need to copy the following files/folders to your user’s home folder (if they don’t exist already)
      • /etc/skel/.bash_logout
      • /etc/skel/.bash_profile
      • /etc/skel/.bashrc
      • /etc/skel/.ssh
  13. To enable exiting to latest working directory in mc (Midnight Commander)
    • echo -e ". /usr/libexec/mc/mc.sh" >> ~/.bashrc
  14. Install useful packages
    • app-misc/mc
    • app-misc/screen
    • sys-apps/mlocate
    • sys-fs/ncdu
    • sys-block/parted
    • app-shells/bash-completion
    • net-misc/dhcp
    • sys-process/dcron
    • dev-vcs/git                            # optional, but recommended
    • app-forensics/rkhunter      # optional - utility to search for rootkits
    • app-portage/genlop            # optional
    • app-portage/portage-utils  # optional
    • app-portage/smart-live-rebuild   # optional
    • net-analyzer/nmap                         # optional
    • net-analyzer/traceroute         # optional
    • net-fs/nfs-utils                        # optional
    • net-fs/samba                          # optional
    • net-ftp/lftp                              # optional
    • sys-apps/gptfdisk                   # optional
    • www-client/lynx                     # optional
    • sys-apps/hwids
    • sys-apps/hwinfo
    • sys-apps/pciutils
    • sys-apps/usbutils
    • sys-block/parted
    • sys-fs/ncdu
    • sys-fs/ntfs3g
    • sys-fs/sysfsutils
    • kde-misc/komparator  # layman overlay 'rainyday': https://gpo.zugaina.org/kde-misc/komparator/ChangeLog
    • games-util/linux-wbfs-manager    # WII wbfs manager for Linux

 

 

 References:

Attached Files
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Name
Email
Security Code Security Code
Related Articles RSS Feed
[Info] Gentoo linux - useful commands
Viewed 1315 times since Mon, Oct 13, 2014
[Guide] Migrate Gentoo Portage to Git
Viewed 1565 times since Sun, Nov 6, 2016
[Info] Useful Gentoo packages
Viewed 1253 times since Sun, Nov 9, 2014
[Info] List of Gentoo packages with required kernel options
Viewed 2451 times since Fri, Sep 23, 2016
MENU