added sshd config.
This commit is contained in:
		
							parent
							
								
									4127c28ed6
								
							
						
					
					
						commit
						b04ab13d39
					
				
					 3 changed files with 23 additions and 2 deletions
				
			
		
							
								
								
									
										20
									
								
								configs/nixos/sshd.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								configs/nixos/sshd.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  inputs,
 | 
			
		||||
  outputs,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  services.openssh = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    settings.PermitRootLogin = "prohibit-password";
 | 
			
		||||
    settings.PasswordAuthentication = false;
 | 
			
		||||
  };
 | 
			
		||||
  # so we dont have to set TERM everytime we ssh in.
 | 
			
		||||
  environment.systemPackages = with pkgs; [
 | 
			
		||||
    kitty.terminfo
 | 
			
		||||
  ];
 | 
			
		||||
  # if it can log into root, it should also be able to log in to the main user.
 | 
			
		||||
  users.users.${config.host.user}.openssh.authorizedKeys.keys =
 | 
			
		||||
    config.users.users.root.openssh.authorizedKeys.keys;
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue