Skip to main content

Posts

Showing posts from November, 2023

ssh - automatically start or attach to ssh-agent

Managing mulltiple ssh-key pairs can be made easy by utilizing the power of ssh-agent. However, I'd like to have my ssh-sessions automatically attach to the ssh-agent or start a instance of ssh-agent if it's not already started. Starting the ssh-agent and attaching to it can be achieved by using these commands: [archy@server ~]$ ssh-agent -s > ${HOME}/.ssh/environment-$(hostname -s) [archy@server ~]$ source ${HOME}/.ssh/environment-$(hostname -s) This will create a file named 'environment-server'  in the folder ~/.ssh with all information required to attach it and then source it to attach to the running ssh-agent. Reconnecting to the running ssh-agent can be done using this command again: [archy@server ~]$ source ${HOME}/.ssh/environment-$(hostname -s) Another thing to consider is not starting multiple ssh-agents, so we'll have to check there is a instance of ssh-agent running for the current user and then determine if we should attach to the currently r

Synology - Multiple VLANs on the same interface

Enabling mutliple VLANs from the WebUI appears to not be possible. Luckily since it's linux under the hood, we can just edit the config files and add multiple vlans and restart the network service. First, edit the current config for the network interface, in my case 'eth0': root@synology:~# cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=none ONBOOT=yes EOF Now, create the config files for each vlan. I'll create them in a simple for-loop using bash: root@synology:~# for vlan in 10 11 12 13; do cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0.${vlan} DEVICE=eth0.${vlan} VLAN_ROW_DEVICE=eth0 VLAN_ID=${vlan} ONBOOT=yes BOOTPROTO=static IPADDR=172.31.${vlan}.248 NETMASK=255.255.255.0 IPV6INIT=off EOF done After all the VLAN-Definitions have been created, make sure to restart the network service: root@synology:~# /etc/rc.network restart Once the Service is restarted, the vlans should be present: