Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rest/server/pamAuth.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func PAMAuthenAndAuthor(r *http.Request, rc *RequestContext) error {
},
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
_, err := ssh.Dial("tcp", "127.0.0.1:22", config)
client, err := ssh.Dial("tcp", "127.0.0.1:22", config)
if err != nil {
glog.Infof("[%s] Failed to authenticate; %v", rc.ID, err)
return httpError(http.StatusUnauthorized, "")
Expand All @@ -134,6 +134,7 @@ func PAMAuthenAndAuthor(r *http.Request, rc *RequestContext) error {
glog.Warningf("[%s] Not an admin; cannot allow %s", rc.ID, r.Method)
return httpError(http.StatusForbidden, "Not an admin user")
}
defer client.Close()

glog.Infof("[%s] Authorization passed", rc.ID)
return nil
Expand Down