WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: basic cribsheet  (Read 170 times)

Offline mark5733

  • Newbie
  • *
  • Posts: 3
basic cribsheet
« on: June 25, 2020, 09:19:04 PM »
After spending just a little bit too long getting this set up for what I need I thought I would post my cribsheet to help those that follow.

I am running these hosts as small VMs to test networking solutions where I need a simple host to ping and run basic scripts, this seems to be perfect at a fraction of the size. Platform is ESXi for info.

I have dumped this text into a script /etc/sysconfig/tcedir/ondemand/h so it's constantly to hand.

tc@Host225:~$ h

# Avoid constantly forgetting to save config
cat /etc/sysconfig/tcedir/ondemand/rb
filetool.sh -v -b
sudo reboot

# Location for scripts
/etc/sysconfig/tcedir/ondemand is persistent and in PATH

# DHCP default gateway metric, change to 10
cat /usr/share/udhcpc/default.script

vi /opt/.filetool.lst

sudo vi /opt/bootlocal.sh
hostname Host225 # put at top of /opt/bootlocal.sh so is set by time udhcpc is triggered
ifconfig eth1 192.168.225.10 netmask 255.255.255.0 up
route add default gw 192.168.225.1

# Remove explict device name (-x hostname:box) so hostname is used
cat /opt/eth0.sh

# Example /opt/.filetool.lst
opt
usr/local/etc/ssh
home
etc/passwd
etc/shadow
usr/share/udhcpc/default.script

Offline mark5733

  • Newbie
  • *
  • Posts: 3
Re: basic cribsheet
« Reply #1 on: June 25, 2020, 09:23:47 PM »
And my sshd setup cribsheet, everything is easier with a decent ssh client

tce-load –wi openssh.tcz
cd /usr/local/etc/ssh/
sudo cp sshd_config.orig sshd_config
sudo /usr/local/etc/init.d/openssh start # Add to /opt/bootlocal.sh
passwd # set password
cat .ssh/authorized_keys # Add public key to save having to login with password

# ssh now working
# easier from here with ssh (paste etc)
« Last Edit: June 25, 2020, 09:25:47 PM by mark5733 »

Offline mark5733

  • Newbie
  • *
  • Posts: 3
Re: basic cribsheet
« Reply #2 on: June 25, 2020, 09:27:30 PM »
tc@Host225:~$ cat /opt/bootlocal.sh
#!/bin/sh
# put other system startup commands here
hostname Host225
/opt/eth0.sh
/usr/local/etc/init.d/openssh start
ifconfig eth1 192.168.225.10 netmask 255.255.255.0 up
route add default gw 192.168.225.1
#route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.225.1 dev eth1     
#route add -net 172.16.0.0 netmask 255.240.0.0 gw 192.168.225.1 dev eth1
#route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.225.1 dev eth1