0

I am using net use commands in a .profile for an sftp client to access file shares from cygwin.

If I ssh to the Windows server and run . .profile, then everything works until the next time the server is reboot.

Is there a way at sshd startup to run a script like a .profile?

4
  • net use is not a cygwin command, it is a Windows command line command.
    – DavidPostill
    Jun 7, 2016 at 9:12
  • Wow... you really butchered your own post with your first edit. Bunch of potentially useful details gone. It looks like sshd is being started by a Windows service. If you check the properties of that service, what is the exact "Path to executable"? (In other words, what is the entire command line that gets run in order to start sshd?) I'm suspecting that info may help show us some rather easy options. (Or, changing that info, via Reg key changes, might provide some options.)
    – TOOGAM
    Jun 7, 2016 at 21:36
  • Path to executable is: C:\cygwin64\bin\cygrunsrv.exe It's just a standard cygwin install on windows. Jun 7, 2016 at 23:14
  • Sorry for butchering my original post: Here's what's in .profile: net use P: /delete, net use P: '\\mysrvr\myshare' /user:myuser mypwd /PERSISTENT:YES. Now this gets invoked in .profile when I ssh to the box and run this command: . .profile HOWEVER: When the box is reboot, the .profile does not run during startup so the file share isn't there. If someone could help me figure out how to fix this so that the startup simulates: 1) ssh to the server, 2) run the command . .profile, I would REALLY appreciate it! Jun 9, 2016 at 17:28

0

You must log in to answer this question.

Browse other questions tagged .