restrict install to a single user
This commit is contained in:
		
							parent
							
								
									a5ea5c2350
								
							
						
					
					
						commit
						e175d088aa
					
				
					 2 changed files with 11 additions and 2 deletions
				
			
		|  | @ -1,5 +1,8 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| # NOTE: %1 is the user being authorized. However, we'll make this only for | ||||
| #       the primary user | ||||
| 
 | ||||
| # Accomodate for local install | ||||
| PATH=$HOME/.local/bin:$PATH | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										10
									
								
								makeitso
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								makeitso
									
										
									
									
									
								
							|  | @ -1,9 +1,15 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| if [ $# -ne 1 ]; then | ||||
|   echo 'usage: makeitso <primaryusername>' >&2 | ||||
|   exit 1 | ||||
| fi | ||||
| 
 | ||||
| sudo adduser --disabled-login --gecos 'User for AuthorizedKeysCommand' authorizedkeysuser | ||||
| 
 | ||||
| sudo sh -c "echo 'AuthorizedKeysCommand /etc/ssh/get_authorized_keys | ||||
| AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config" | ||||
| sudo sh -c "echo 'Match User $1 | ||||
|   AuthorizedKeysCommand /etc/ssh/get_authorized_keys | ||||
|   AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config" | ||||
| 
 | ||||
| sudo cp authorized_keys /etc/ssh | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue