How to

Use Windows 10 home folder as WSL Ubuntu shell home directory

WSL-Ubuntu

As I moved on professionally and started to develop dotnet applications for Windows I had to switch my OS from MacOSX to Windows (I still use MacOSX for other stuff). So this change forced me to adapt to a new environment – or better, to go back to a previous one – anyway, I still miss my shell and all it’s features.

Fortunately, Windows 10 can run a WSL and I can use the Ubuntu shell as my main one. If you use a shell regularly you probably often use the commands: cd or the shortcut ~/Downloads for example, and that is a problem because the WSL Shell home is located, in my case, at /home/walter and my user (windows) home is at C:/Users/Walter (/mnt/c/Users/Walter) so: how can I change my default home shell so I can use the home shell directory as the same as the OS home directory?

Quite easy, open a new shell and type:

1
sudo vim /etc/passwd

Search for your username, must look something like that:

1
walter:x:1000:1000:,,,:/home/walter:/bin/bash

and change your home directory /home/walter to the one that you want to use, in my case I changed it to /mnt/c/Users/Walter

1
walter:x:1000:1000:,,,:/mnt/c/Users/Walter:/bin/bash

save and exit vim.

You can copy your user definition

1
cp /home/walter/.bash* /home/walter/.profile /mnt/c/Users/Walter/

Close and re-open the shell and you’re good to go.

Windows 10 connect to NAS with smb1 (Samba, the old one)

Since Windows 10, microsoft remove the support for Samba 1, the problem is that I still have that old NAS who only support SMB1, so here’s the error shown:

You can't connect to the file share because it's not secure. This share requires the obsolete SMB1 protocol, which is unsafe and could expose your system to attack.
Your system requires SMB2 or higher. For more info on resolving this issue, see: https://go.microsoft.com/fwlink/?linkid=852747

And the solution is realy easy.

  1. Open control panel
  2. Search for Turn Windows features on or off
  3. Scroll down to SMB 1.0/CIFS File Sharing Support and activate the checkbox to activate que option
  4. Restart and you’re done

Android FX Explorer can’t connect to Raspberry pi with OSMC via SSH

Since the last update of OSMC in my Raspberry PI I was unable to connect from my smartphone using this awesome app called FX Explorer on the other and I still can use Juiced SSH.

So I had to dig on that problem!

After I little search I finally manage to find the problem, the last version of OSMC had a different configuration

1
$ sudo vim /etc/ssh/ssh_config

That was a missing algorithm in that line:

1
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256

Just add

1
diffie-hellman-group-exchange-sha1

So the line looks like:

1
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1

Now save, exit and restart sshd service

1
$ sudo systemctl restart sshd

And you’re done!