dokan sshfs for windows - sshfs

I read an article here about dokan sshfs for windows. I want to ask if you know similar software (free or not) in order to access windows partitions from windows. Samba is a always an answer, however I am seeking for something more secure.

You can use the Dokan SSHFS client with the OpenSSH server for Windows, you can configure OpenSSH like you would on UNIX, then use the Dokan SSH client to connect remotely, just as you would do on UNIX with sshfs.
When you say Samba, so you mean SMB? Samba is the *NIX client/server for SMB.

SSHFS for accessing Windows partitions from Windows ? Did you by any chance mean Linux partitions from windows ?
If windows-windows, then sorry, no. sshfs is a Linux/Unix feature, and microsoft does all it can to NOT make it work on Windows (after all, that would allow to easily and securely migrate from Windows to Linux). On Windows, you use WebDAV to accomplish similar things, needless to say WebDAV is way more insecure than sshfs.
If you meant accessing remote Linux partitions from Windows, then I had the same problem before:
Dokan doesn't work, at least not on Vista x64. (epic bluescreen crash)
The java sshfs explorer on sourceforge doesn't work, either.
Microsoft's services for unix (including sshfs) are only available on Vista 'Ultimate', not on < Ultimate, like my Vista business for example.
There are some commercial solutions, but first, they are way overpriced, and second, I wouldn't trust them, since they don't offer evaluation.
My solution was to install VirtualBox on Windows, and install an Ubuntu guest on it, mounting the host's C drive. You need to set the VirtualBox network adapter to bridged mode to make sshfs work with virtualization. I'm sorry, but so far that's the only free solution that really works...

imdisk driver, see if http://www.ltr-data.se/opencode.html helps.
From the documentation
It is even possible to boot a machine
with NTFS partitions using a Unix
Live-CD and use the included devio
tool to let ImDisk on another computer
running Windows on the network mount
the NTFS partition on the machine you
booted with the Unix Live-CD. This way
you can recover information and even
run chkdsk on drives on machines where
Windows does not boot.

I've been using Win SSHFS for awhile, is this what you're looking for?
https://github.com/Foreveryone-cz/win-sshfs/
It runs on top of Dokany

Related

Can I run one WSL2 virtual machine instance on two system?

I'm new to the WSL2 and wondering if it's possible to run the same WSL2 ubuntu instance on both my desktop and laptop.
Now I am able to use wsl --export and wsl --import method to save and load the system to/from my portable hard drive. But these methods takes a long time.
I notice that wsl --import load a file named ext4.vhdx. Is there a way to load straightly from this file?
Update v2.0:
I was able to get a workaround and it works great.
Thanks to Booting from vhdx here, I was able to load straightly from my vhdx file on my portable hard disk. Windows track down its subsystem with regedit, So we can write our own(p.s: make sure to get BasePath right, it starts with "\\\\?", or you will not be able to access the subsystem' filesystem on your host system.):
Windows Registry Editor Version 5.00
[HKEY_USERS\【your SID here】\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{【UUID here】}]
"State"=dword:00000001
"DistributionName"="distribution name"
"Version"=dword:00000002
"BasePath"="vhdx folder path" 【 e.g. "\\\\?\\E:\\S061\\WSL\\ubuntu-20"】
"Flags"=dword:0000000f
"DefaultUid"=dword:000003e8
I suppose the best way to do this would be to store ext4.vhd on a network storage device accessible to both devices.
I have previosly mentioned how to move ext4.vhd. You can check that out here
Basically you need to export from one machine and import it while making sure the vhd file is configured for wsl to access from the network storage
Since this should *officially* not supported expect some performance hits
Another way would be to run WSL on one computer and ssh/remote desktop to it from another device on the network
I'm of the strong belief that sharing the same ext4 vhd between two VM's simultaneously would be a bad idea. See this and this Unix & Linux StackExchange, including the part about ...
note that sharing LVs/partitions on a single disk between the servers at the same time is NOT very safe. You should only access whole disks from any of the servers at one time.
However, as dopewind's answer mentioned, you can access the WSL instance on one computer (probably the desktop) from another (e.g. the laptop). There are several techniques you can use:
If you have Windows 10 Professional or Enterprise on one of the computers, you can enable Remote Desktop, which allows you to access pretty much everything on one computer from another. RDP ("Remote Desktop Protocol") even works from other devices such as an iPad or Android tablet (or even a phone, although that's a bit of a small screen for a "desktop"). That said, there are better, more idiomatic solutions for WSL ...
You could enable SSH server on the Windows 10 computer with the WSL instance (instructions). This may sound counterintuitive to some people, since Linux itself running in the WSL instance also includes an SSH server (by default). But by SSH'ing from (for example) your laptop into your desktop's Windows 10, you can then launch any WSL instance you have installed (if you choose to install more than one) via wsl -d <distroName>. You also avoid a lot of the network unpleasantness in the next option ...
You could, as mentioned above, enable SSH on the WSL instance (usually something like sudo service ssh start) and then ssh directly into it. However, note that WSL2 instances are NAT'd, so there's a whole lot more hackery that you have to do to get access to the network interface. There's a whole huge thread on the WSL Github about it. Personally, I'd recommend the "Windows SSH Server" option mentioned about to start out with, then you can worry about direct SSH access later if you need it.
Side note: Even though I have SSH enabled on my WSL instances, I still use Windows SSH to proxy to them, to avoid these networking issues.

Is there a way to sync ssh directory keys across multiple devices?

I have two windows and one Ubuntu devices that I regularly work with, and I was wondering if there is a way for me to sync the ssh directory for each of the device so that they all have the same ssh key, config, and authorized_key? For windows I'm using the Ubuntu terminal from Microsoft store.
I personally don't recommend this, but it has been answered here. See the answer by #trisweb about scp. Hope this helps

QEMU Virtual Machine: Creating a shared folder between Windows 10 (host) and Solaris 2.7 (guest)

I was wondering if anyone could give me wisdom on how to create a shared folder between my host machine (running Windows 10) and the virtual machine I created in qemu which is running Solaris 2.7. I need a way to get files in and out of the VM.
I've managed to "plug in" a folder as a virtual drive into the VM, using
-drive file=fat:rw:[folder],bus=0,unit=1,if=scsi,format=raw,media=disk
in the VM invocation. Solaris sees this as a disk, but I'm unsure where to go from here. I can't seem to format it because I don't know the "disk" geometry (apparently Solaris was very particular about this). I tried mounting the unformatted drive in Solaris but it wasn't able to do that either. I even tried giving it an entry in /etc/vfstab to see if I could get it to automount, but that didn't work either.
Is there a different way I should be mounting it? Or is there a trick to getting Solaris to use this virtual drive? I'm also open to other alternatives people are aware of for transferring files in/out of my VM, but since Solaris 2.7 is a rather old operating system, things like networking (for example) aren't trivial to set up (and even basic things like ssh are missing).
Any help would be appreciated!

Working on remote server

My OS: Windows 8
Virtualbox guest: Ubuntu 12.10 server
I configured apache server on vbox guest and mapped http, https, ssh port successfully into ubuntu server. It works nice without any problem.
I tried several IDEs like PHPStorm, Netbeans, editors like Sublime, all they do is to copy whole project from server, edit on local machine then sync back.
But it is not what I need. I want to work directly on guest server using ssh/sftp connection. I know that notepad++ has this functionality but I love sublime look and feel.
Is there any way to work on guest server with sublime or any other ide for free? (There is sftp solution but it's paid and works just like other ide's, not directly on guest machine) Any suggestions?
There are two approaches you can choose from, you will probably select the second one:
Use the KDE desktop environment (yes, it also exists for MS Windows). It features so called 'kio-slaves' which allow to use any protocol out there as if you were doing local file system operations. That means when using a KDE editor like 'kate' or even a whole IDE like 'kdevelop4' you can simply say "open file/project" and not only choose a local file, but something like sftp://server/path/file and start working. The network stuff is handled transparently by the environment, it is fully network transparent. This is how systems should be like. I think the GNOME environment had something similar, but it probably has been removed with version 3 of GNOME.
You can 'mount' the guests file system into your MS-Windows file system. not sure about the details how this works in MS-Windows, but I am sure that at least newer versions of MS-Windows have gained such feature. Most likely you are still limited to creating something like a "network harddrive" or something, in other systems (linux, unix, macOS) you can mount whereever in the file system you like. You can use any protocol for this, as long as it is supported by the mounting tools of your local system.
Again two options:
2.a You mount the whole virtual disk. Easy, but might be a problem if that disk is currently used by the guest system.
2.b You export the virtual disk by starting some server in the virtual system: samba is most likely your choice. Then you can mount that smb file export inside your MS-Windows system and start hacking.
Have fun!

Get remote cmd from linux termnal

I need to run some scripts in a windows remote machine from a terminal linux, I've tried using telnet however in the windows machine it's unable and there isn't installed a ssh server. So I need other way to run the command remotely without a graphical interface.
I have the possibility for run the command from a windows machine, however I need to open a SSH Tunnel to see the remote machine, I've used psexec but it didn't work for me.
Do you have access to install software on the remote server?
Your SSH client will not be able to connect to the remote machine unless that machine is running an SSH server to respond to your client's connection request.
There are a number of possible options for SSH servers to run on Windows.
(Google for ssh server windows)
Because SSH gives an external user some access to/control over your server it is designed to be a secure tool. I would therefore recommend using an SSH server which is still actively maintained, and keep it up to date. Servers which are old and no longer supported are are likely to contain known security issues which may never be addressed, thereby leaving your server vulnerable.
There are a number of good free open-source solutions for this, so you shouldn't need to buy anything.
In the past I've worked with Windows machines running Cygwin, with the OpenSSH ssh server installed. Depending how much of the Cygwin system you choose to install, it can make the target Windows host rather like logging into another Linux box in terms of environment.
You can download the installer for Cygwin from http://www.cygwin.com/