access Linux from Windows: SSH terminal, files, web

 

I've been using Ubuntu as the operating system (OS) for my main computer for years, but recently still gave my old Windows machine another chance. The reasons are mainly the use of Office: Outlook, Word, Excel, and the use of Visual Studio. I was more than satisfied with Ubuntu as a client OS for a long time, thanks to the Office Online version and Visual Studio Code instead of Visual Studio and because I rarely used the products. Nevertheless, I wanted a computer with which I can start everything again.

Windows as client OS, Linux for the server

Since my Linux PC, a self-built NAS, uses Ubuntu as OS, I wanted to leave the data there and just use it from there. My goal: the best combination of both worlds: Windows as OS to work with and my Linux installation, so its services, to use from Windows. That would be about the same as the rest of the world does: a look at the statistics shows that Windows is still number one as a desktop client operating system, differently for server operating systems: Linux-based operating systems are clearly ahead there. Much of what a Linux system provides as a service can be accessed via the browser, but the server itself must also be administered, usually via the terminal:

Linux commands Terminal access

As is well known, a console or terminal is used to execute commands on a Linux system. To access the console over the network, the SSH protocol is usually used.

putty

Probably the best known tool for remote connection to a Linux system is the small tool "putty".

see, vendor: www.chiark.greenend.org.uk/~sgtatham/putty

Windows Subsystem for Linux (WSL)

Even easier is the use of WSL, the "Windows Subsystem for Linux"

WSL allows you to start a Linux terminal in Windows and thus use the SSH command for remote connection to a Linux computer:

user@DESKTOP-???:~$ ssh root@192.168.1.1

If you generate an SSH key at this point for the login, you do not have to use a password for the connection, see: Ubuntu automatic SSH login

File and folder access

WinSCP

What "putty" is for the terminal, WinSCP is for file transfer. WinSCP allows access to specific files or folders via SSH, FTP, SFTP, SCP, ...

Download, see Vendor: winscp.net 6.3

If you want to connect a Linux filesystem directly as a network drive, you can use WinFsp:

Connect WinFsp Linux filesystem as Windows network drive.

With the Windows File System Proxy: WinFsp it is possible to connect a Linux filesystem as a network drive via SSH, see also: github.com/billziss-gh/sshfs-win/releases/tag/v3.5.20357 and github.com/billziss-gh/sshfs-win/releases/tag/v3.5.20357

To mount a network drive, you can then simply use the net use command or the Windows Explorer "Mount network drive" dialog:

net use w: \\sshfs.r\username@192.168.1.5\.\var\web

Alternatively: connect network drive: rightclick on "Network" and "Show more options" and "Map network drive ..."

To be able to control the folder rights on the Linux PC better, one can think about an own Linux user, this can be created on the Linux computer as follows:

user@server:/var/web$ sudo useradd win2linux
[sudo] Passwort für user:
user@server:/var/web$ sudo passwd win2linux

If you do not want to use SSH as protocol for access, but want to access a network drive of a Linux system via the Windows protocol SMB, you need a Samba server on the Linux system:

Samba - Server

Alternatively, a Windows share can be created on the Linux system: The Linux system then behaves like a Windows file server and shares files via SMB (Server Message Block protocol)

In the end, however, I use neither Samba, nor WinSCP, nor FileZilla or WinFsp to access my data, but Nextcloud:

Nextcloud

On my NAS, I deployed Nextcloud via a Docker container. Nextcloud offers a simple and elegant solution to share your own files from different devices: For Windows, there is a separate sync client, which synchronizes all required folders to the local hard drive, similar to OneDrive or Dropbox. The communication runs thereby over the HTTP protocol (Hypertext Transfer Protocol), thus the protocol which is used also for the access to a web page.

See also: Docker Nextcloud SSL - letsencrypt https

For accessing my development environment I also use VSCode:

Visual Studio Code (VS Code) - Remote

I also have some Docker containers on my NAS, including a trial version of this site. So for the switch to Windows I need a solution to customize the container if needed, i.e., to be able to develop on the file system of the NAS. One possibility would be the previously presented Windows File System Proxy, but it is even easier: VS Code can access the Linux machine directly via SSH using the "Remote SSH extension" and behaves as if the Linux PC is used:

See: code.visualstudio.com/docs/remote/ssh-tutorial.

I was already a big fan of VS Code before: but the remote SSH extension is definitely another highlight and has convinced me once again.

Conclusion

In the last few years, using a Linux distribution as a Windows client replacement has become more and more attractive: A lot of things are done in the browser nowadays and more and more programs or games can now be run under Linux, see also: Linux as a replacement for Windows? Getting Started: Switching?. Nevertheless, there are still programs that cannot be started on a Linux system, first and foremost Microsoft Officeand certain games. If you can do without these, you are in good hands with a Linux distribution, and at the latest when the PC hardware no longer supports Windows 11. Ubuntu or Linux Mint, for example, offer a modern OS that can be run on the existing hardware without further ado.

positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!

Updated: 2024-02-16 von Bernhard | Übersetzung Deutsch |🔔 | Comments:0

Convert date: Unix Timestamp | Linux | Ubuntu automatic SSH login

Top articles in this section


Fan control Linux Debian: Fancontrol

After I installed a fan in my NAS, it always ran at top speed. In the BIOS I could set the speed, but the automatic mode did not work properly. Using the service fancontrol the speed of the fan can be linked to any sensor and any threshold and controlled automatically.


Linux folder used space - Bash TreeSize

To find out which folder needs how much space, the command “du” can be used on Debian. For an even better overview there is the commandline tool ncdu, which can analyze all folders similar to TreeSize.


Debian or Ubuntu kernel update or change- current kernel

The currently available Linux kernel has the version: 6.8.7 (found: 2024-04-17). Source: www.kernel.org. The Linux distributions, as an example Debian or Ubuntu used new kernel versions only with some delay, accordingly the used kernel versions are usually somewhat older. Which kernel is active on a Linux system can be read out with the following command:

Questions / Comments


By continuing to browse the site, you agree to our use of cookies. More Details