Version 1.3.0
In case the password must provided interactively, it is now invisible.
This commit is contained in:
		
							parent
							
								
									a16b99af6e
								
							
						
					
					
						commit
						c85e21231b
					
				
							
								
								
									
										13
									
								
								Main.go
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								Main.go
									
									
									
									
									
								
							@ -3,14 +3,17 @@ package main
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"github.com/SommerEngineering/SSHTunnel/Tunnel"
 | 
			
		||||
	"github.com/howeyc/gopass"
 | 
			
		||||
	"golang.org/x/crypto/ssh"
 | 
			
		||||
	"log"
 | 
			
		||||
	"os"
 | 
			
		||||
	"runtime"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
 | 
			
		||||
	// Show the current version:
 | 
			
		||||
	fmt.Println(`SSHTunnel v1.2.0`)
 | 
			
		||||
	log.Println(`SSHTunnel v1.3.0`)
 | 
			
		||||
 | 
			
		||||
	// Allow Go to use all CPUs:
 | 
			
		||||
	runtime.GOMAXPROCS(runtime.NumCPU())
 | 
			
		||||
@ -23,7 +26,13 @@ func main() {
 | 
			
		||||
		if password == `` {
 | 
			
		||||
			// Promt for the password:
 | 
			
		||||
			fmt.Println(`Please provide the password for the connection:`)
 | 
			
		||||
			fmt.Scanln(&password)
 | 
			
		||||
			if pass, errPass := gopass.GetPasswd(); errPass != nil {
 | 
			
		||||
				log.Println(`There was an error reading the password securely: ` + errPass.Error())
 | 
			
		||||
				os.Exit(1)
 | 
			
		||||
				return
 | 
			
		||||
			} else {
 | 
			
		||||
				password = string(pass)
 | 
			
		||||
			}
 | 
			
		||||
		} else {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user