more fixes, to get my ssh config working

This commit is contained in:
Sebastian Moser
2023-10-28 19:43:12 +00:00
parent 02ae59ea1a
commit c2705c1feb
2 changed files with 13 additions and 16 deletions

View File

@@ -127,29 +127,30 @@
# a little programm, that changes the ssh config to always be able to acces rpi # a little programm, that changes the ssh config to always be able to acces rpi
function rpi(){ function rpi(){
ssh_dir=~/.ssh
if [ "$1" == "l" ] if [ "$1" == "l" ]
then then
cp ~/work/config/ssh/rpi/local ~/work/config/ssh/current_pi_config cp $ssh_dir/rpi/local $ssh_dir/current_rpi_config
fi fi
if [ "$1" == "local" ] if [ "$1" == "local" ]
then then
cp ~/work/config/ssh/rpi/local ~/work/config/ssh/current_pi_config cp $ssh_dir/rpi/local $ssh_dir/current_rpi_config
fi fi
if [ "$1" == "r" ] if [ "$1" == "r" ]
then then
cp ~/work/config/ssh/rpi/remote ~/work/config/ssh/current_pi_config cp $ssh_dir/rpi/remote $ssh_dir/current_rpi_config
fi fi
if [ "$1" == "remote" ] if [ "$1" == "remote" ]
then then
cp ~/work/config/ssh/rpi/remote ~/work/config/ssh/current_pi_config cp $ssh_dir/rpi/remote $ssh_dir/current_rpi_config
fi fi
if [ "$1" == "w" ] if [ "$1" == "w" ]
then then
cp ~/work/config/ssh/rpi/wstunnel ~/work/config/ssh/current_pi_config cp $ssh_dir/rpi/wstunnel $ssh_dir/current_rpi_config
fi fi
} }

View File

@@ -3,44 +3,40 @@
home-manager.users.me.programs.ssh = { home-manager.users.me.programs.ssh = {
enable = true; enable = true;
includes = [ "./current_rpi_config" ]; includes = [ "./current_rpi_config" ];
/*
matchBlocks = { matchBlocks = {
"github.com" = {
hostname = "github.com";
identityFile = "${secretsDir}/private-key-main";
};
hpm = { hpm = {
hostame = "192.168.1.56"; hostname = "192.168.1.56";
user = "root"; user = "root";
}; };
servers = { servers = {
hostname = "192.168.1.3"; hostname = "192.168.1.3";
user = "server"; user = "server";
extraConfig = ''
AddKeysToAgent yes
'';
identityFile = "${secretsDir}/private-key-main"; identityFile = "${secretsDir}/private-key-main";
}; };
server = { server = {
hostname = "192.168.1.3"; hostname = "192.168.1.3";
user = "admin"; user = "admin";
extraConfig = ''
AddKeysToAgent yes
'';
identityFile = "${secretsDir}/private-key-main"; identityFile = "${secretsDir}/private-key-main";
}; };
ocia = { ocia = {
hostname = "140.238.212.229"; hostname = "140.238.212.229";
user = "root"; user = "root";
identityFIle = "${secretsDir}/private-key-ocia"; identityFile = "${secretsDir}/private-key-ocia";
}; };
ocib = { ocib = {
hostname = "140.238.211.43"; hostname = "140.238.211.43";
user = "root"; user = "root";
identityFIle = "${secretsDir}/private-key-ocib"; identityFile = "${secretsDir}/private-key-ocib";
}; };
}; };
*/
}; };
home-manager.users.me.home.file.".ssh/rpi/local".text = '' home-manager.users.me.home.file.".ssh/rpi/local".text = ''