To FAQ: On OpenSSH
OK, this is not a WinSCP support question, indeed it is not a support question at all :-)
While fiddlig around, I found myself in need of some non-standard use, I couldn't find any answers; so I sat down and did my own work.
Also, I was not able to locate anyone doing an OpenSSH for Windows FAQ, so at the moment the best place seemd to send it to WinSCP forum.
After some editing, you may like to add it to the FAQ,
Maybe some other folk need them, so here they are:
Q: How do I login as <virtual_user> into Windows machine without having to create a user called <virtual_user>.
A:
You must already have created a 'passwd' as below
<some_apth>\OpenSSH\etc\passwd
Now, open 'passwd' file in notepad.exe (or your favorite text editor), you should see a number of lines which are the users in your domain/workgroup and your local machine.
It looks something like these:
<windows_user_1>:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_1>:/bin/switch
<windows_user_2>:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_2:/bin/switch
<windows_user_3>:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_3>:/bin/switch
Where <windows_user_n> represents your real users, and the capital letters represent the stuff that Windows need.
If you do not want <windows_user_x> logging in, you need to delete the corresponding <windows_user_x> line in 'passwd' file.
In my case, I wanted to login from Linux as 'root' with 'Administrator' rights on the Windows machine.
To do this, I duplicated the line that began with 'Administrator' and replace 'Administrator' with 'root' for that line, so that they looked something like below.
Administrator:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_2:/bin/switch
root:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_3>:/bin/switch
In this case, anyone logging in as 'root' will have have the same access rights as 'Administrator'. You may want to use some other user name as template for 'root'.
In any case, the general thing applies: You use a Windows user line as a template and create a virtual user for OpenSSH.
<windows_user>:unused_by_nt/2000/xp:500:513:XXX:/home/<windows_user>:/bin/switch
<virtual_user>:unused_by_nt/2000/xp:500:513:XXX:/home/<virtual_user>:/bin/switch
Q: How do I login and start from an arbitrary path (say C:\), instead of Windows's homepath.
A:
In Registry.exe, you need to create a couple of keys and string values, such as these:
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/openssh_home
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/openssh_home
BTW, I did not check whether the forward slash was necessary in '/openssh_home', I just followed CygWin/OpenSSH conventions.
Then, you need to create a String Value with label 'native' and the string value is the full qualified path --in my case, it was simply 'C:\'.
You may need to omit the backslash (from 'C:\') if you need to add further sub directories.
One final point: OpenSSH service is quite sensitive to how many 'cygwin1.dll's you have in your system. If it finds more than one, it will refuse to stop and emit a cryptic message. You can find out what has gone wrong if you look into this file
<some_apth>\OpenSSH\var\log\OpenSSHd.log
Once you have satisfied those, OpenSSH should work.
While fiddlig around, I found myself in need of some non-standard use, I couldn't find any answers; so I sat down and did my own work.
Also, I was not able to locate anyone doing an OpenSSH for Windows FAQ, so at the moment the best place seemd to send it to WinSCP forum.
After some editing, you may like to add it to the FAQ,
Maybe some other folk need them, so here they are:
Q: How do I login as <virtual_user> into Windows machine without having to create a user called <virtual_user>.
A:
You must already have created a 'passwd' as below
<some_apth>\OpenSSH\etc\passwd
Now, open 'passwd' file in notepad.exe (or your favorite text editor), you should see a number of lines which are the users in your domain/workgroup and your local machine.
It looks something like these:
<windows_user_1>:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_1>:/bin/switch
<windows_user_2>:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_2:/bin/switch
<windows_user_3>:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_3>:/bin/switch
Where <windows_user_n> represents your real users, and the capital letters represent the stuff that Windows need.
If you do not want <windows_user_x> logging in, you need to delete the corresponding <windows_user_x> line in 'passwd' file.
In my case, I wanted to login from Linux as 'root' with 'Administrator' rights on the Windows machine.
To do this, I duplicated the line that began with 'Administrator' and replace 'Administrator' with 'root' for that line, so that they looked something like below.
Administrator:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_2:/bin/switch
root:unused_by_nt/2000/xp:AAA:BBB:XXX:/home/<windows_user_3>:/bin/switch
In this case, anyone logging in as 'root' will have have the same access rights as 'Administrator'. You may want to use some other user name as template for 'root'.
In any case, the general thing applies: You use a Windows user line as a template and create a virtual user for OpenSSH.
<windows_user>:unused_by_nt/2000/xp:500:513:XXX:/home/<windows_user>:/bin/switch
<virtual_user>:unused_by_nt/2000/xp:500:513:XXX:/home/<virtual_user>:/bin/switch
Q: How do I login and start from an arbitrary path (say C:\), instead of Windows's homepath.
A:
In Registry.exe, you need to create a couple of keys and string values, such as these:
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/openssh_home
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/openssh_home
BTW, I did not check whether the forward slash was necessary in '/openssh_home', I just followed CygWin/OpenSSH conventions.
Then, you need to create a String Value with label 'native' and the string value is the full qualified path --in my case, it was simply 'C:\'.
You may need to omit the backslash (from 'C:\') if you need to add further sub directories.
One final point: OpenSSH service is quite sensitive to how many 'cygwin1.dll's you have in your system. If it finds more than one, it will refuse to stop and emit a cryptic message. You can find out what has gone wrong if you look into this file
<some_apth>\OpenSSH\var\log\OpenSSHd.log
Once you have satisfied those, OpenSSH should work.