Frequently Asked Questions
Can I use HomeDir Property as default path in case of ServiceType = stShell?
Yes of course. In order to set default directory for the user which logs into the server, you can do something like this:
Private Sub SSHD1_ServiceRequest(ByVal User As wodSSHDComLIB.ISSHUser, ByVal ServiceIndex As Long, ServiceType As wodSSHDComLIB.SSHServiceTypes, ServicePath As String, Action As wodSSHDComLIB.SSHActions )
If ServiceType <> stShell Then Action = Deny
ServicePath = ServicePath & " /k ""cd /d " & User.HomeDir & """"
End Sub
In this example /k means "execute command and remain inside" and /d means "change drive if neccessary". The above code is actually same as if you were to run CMD.exe with some additional parameters (CMD.EXE /k "cd /d c:\\somehomedir").
Last updated Fri, Nov 8 2013 12:00am