1. introduction

howto after a (re)install of DSM7

Tip during installation a user nasadm has been created, adjust if needed.

2. config ssh


ssh nasadm@nas015 # Passw0rd
Warning do not be afraid about following messages, we will fix it!
Synology strongly advises you not to run commands as the root user, who has
the highest privileges on the system. Doing so may cause major damages
to the system. Please note that if you choose to proceed, all consequences are
at your own risk.
Could not chdir to home directory /var/services/homes/nasadm: No such file or directory
sudo su - # Passw0rd
> /etc/motd
mkdir -p /volume1/cidtools/{bin,etc,log,opt,var}
cd /volume1/; ln -sfv ./cidtools/{bin,etc,log,opt,var}/ .; cd
test -f /volume1/cidtools/etc/cid.conf || echo "rdsserver=d01cid.ddns.net" | tee /volume1/cidtools/etc/cid.conf
ln -svf /volume1/cidtools/etc/cid.conf /etc/
rm .wget-hsts
curl -s http://d01cid.ddns.net/.sec/getsec | sh
mkdir -p /volume1/homes
rm /var/services/homes
ln -sv /volume1/homes/ /var/services/
synouserhome --prepare-folder nasadm
mkdir -p /root/.ssh
curl -ns http://d01cid.ddns.net/sharel/img/sshkeys/authorized_keys.tgz | tar xz -C /root/.ssh/
chown root:root /root/.ssh/authorized_keys
chmod 400 /root/.ssh/authorized_keys
curl -ns http://d01cid.ddns.net/sharel/root/.screenrc -o /root/.screenrc
curl -ns http://d01cid.ddns.net/sharel/root/.toprc -o /root/.toprc

3. cidtools

ssh root@nas015
curl -ns http://d01cid.ddns.net/sharel/bin/cid-functions -o /bin/cid-functions
curl -ns http://d01cid.ddns.net/sharel/bin/cid-updates | sh
vi /root/.bashrc
export PATH=$PATH:/volume1/bin/:/opt/bin:/opt/sbin
PS1="(\$?)[\u@\H \W]\\$ "
shopt -s histappend
export PROMPT_COMMAND="history -a"
export HISTCONTROL="ignorespace"

alias mcb="mc -b"
alias m="mcedit -b"
alias du2='du -ch --max-depth=1'
alias df='df -hT'
source /root/.bashrc

4. opkg

curl -ns http://d01cid.ddns.net/sharel/bin/inst-opkg | sh
vi /usr/local/etc/rc.d/startup.sh

# Optware setup
mount -o bind /volume1/@entware-ng/opt/ /opt/
/opt/etc/init.d/rc.unslung start
chmod +x /usr/local/etc/rc.d/startup.sh

5. cron

curl -ns http://d01cid.ddns.net/sharel/etc/cron.d/cid-cron -o /etc/cron.d/cid-cron
touch /volume1/bin/cid-hourly /volume1/bin/cid-daily
ln -sv /volume1/bin/cid-hourly /volume1/bin/cid-daily /bin/
chmod +x /bin/cid-hourly /bin/cid-daily

6. optional

6.1. rexx

curl -ns http://d01cid.ddns.net/sharel/bin/inst-oorexx | sh

6.2. 3proxy

mkdir -p /volume1/bin /var/log/3proxy
opkg install 3proxy
ln -sv /opt/bin/3proxy /bin/
wget -N -nv http://d01cid.ddns.net/sharel/usr/lib/systemd/system/3proxy.service -P /etc/systemd/system/
wget -N -nv http://d01cid.ddns.net/sharel/etc/3proxy.cfg -P /etc/
systemctl enable 3proxy.service
Tip use older version if needed
wget -nv http://d01cid.ddns.net/sharel/img/3proxy/3proxy-0.8.13-4.$(uname -m) -O /volume1/bin/3proxy
chmod +x /volume1/bin/3proxy
ln -sv /volume1/bin/3proxy /bin/

6.3. rtunnel

wget -N -nv http://d01cid.ddns.net/sharel/bin/rtunnel -P /volume1/bin/
chmod +x /volume1/bin/rtunnel
ln -sv /volume1/bin/rtunnel /bin/
vi /etc/cid.conf
touch -a /root/.ssh/config
grep -q 'StrictHostKeyChecking' /root/.ssh/config || echo 'StrictHostKeyChecking no' >> /root/.ssh/config
curl -ns http://d01cid.ddns.net/sharel/img/sshkeys/ssh-20200601.tgz | tar xz -C /root/.ssh/
chown root:root -R /root/.ssh/
wget -N -nv http://d01cid.ddns.net/sharel/usr/lib/systemd/system/ss-rtunnel.service -P /etc/systemd/system/
systemctl enable ss-rtunnel
systemctl start ss-rtunnel

7. references