Wednesday, December 21, 2022

MX Linux Samba (or maybe not) SSH Is Awesome

01-05-2024 I think I'll jump ship on my default Linux distro. MX is crisp, fast and I liked the idea of not bowing to systemd but systemd is the way Linux is going ao might as well get used to it. Mint is a suitable landing place.

There may be some reason to use a Linux distro other than MX but I can't think of a good one.
OK, hacking but other than that . . .
So, you need to transfer files from and to Windows and Linux . . .
. . . or maybe from Windows to Windows and Windows network just doesn't work?
I'll do anything to keep from plugging in a flash drive 😎

MX makes Samba easy, sort of - with these hints.
sudo mkdir -p /home/share
(I tried mkdir in the user dir but couldn't change permissions)
sudo chmod -R 0777 /home/share
sudo chown -R yourname /home/share
Check Shares    sudo smbstatus --shares

Run MX Samba setup and point to share
sudo service smbd restart
sudo service nmbd restart

I can't always get to Windows network from MX. Yes, it is painful.

When logging on from Windows to Linux 
Try this . . . If Windows rejected credentials
Use your Microsoft email address
User:MicrosoftAccount\me@email.com
Example: you are Bob and your Microsoft email is BobBarker@live.com and your local PC password is 1234
Enter Bob/BobBarker@live.com - 1234
It works even if you are running Windows with local account.
I know - It's crazy

If all else fails or instead of suffering . . .
Linux to Windows
Xlight server on Windows (simply the easiest ftp server)
Filezilla client on MX or any Linux
or . . .
Windows to Linux
"sudo service ssh start" on MX (clear port 22 on firewall) if ssh not installed, do it.
(Doing ssh -V gives result but server needs installation anyway)
WinSCP on Windows
*** SSH may need to be installed even in MX
sudo apt update
sudo apt install openssh-server
sudo service ssh start (as opposed to system d "sudo systemctl start ssh")
No need to enable on MX it starts at reboot (I think). If not see auto start below.
MX manual says:
Start or restart the ssh daemon as root with the command:
/etc/init.d/ssh start
To auto start at boot:
Session and Startup and add /etc/init.d/ssh start
You may need to edit the /etc/ssh/ssh_config
sudo nano /etc/ssh/ssh_config
After config edit . . .
sudo service ssh restart
To check if ssh running
sudo service ssh status
and . . .
Remember to either turn off the Firewall
sudo ufw status

Or allow port 22
sudo ufw allow ssh
or
sudo ufw allow 22/tcp
or
Use the GUI

Or use a python simple server
Or just use . . .
AnyDesk is often an option depending on the Linux distro.

To sum up a quick setup
sudo apt update
sudo apt install openssh-server
sudo service ssh start
sudo ufw allow ssh
sudo nano /etc/ssh/ssh_config
sudo service ssh restart

Bonus:
1. I don't know why first 10, 15, 25 things to do in xyz-linux never mentions it but . . .
sudo apt install fsearch (it's everything search for linux)
2. Need Linux for your Ventoy drive? Make a snapshot ISO after you get MX updated and just the way you like it and drop the ISO on your Ventoy drive.
3. This is turning into an MX tutorial. This video is full of MX setup info.

In Mint
to install ssh sudo apt install openssh-server to check if enabled sudo systemctl is-enabled ssh if disabled do this sudo systemctl enable ssh sudo systemctl start ssh sudo systemctl status ssh firewall sudo ufw allow ssh sudo ufw status verbose !! Be sure to edit sshd_config port 22 & authorization

Curl, Wget, Winget & Powershell Install or Download Commands

After the mess I made in previous posts this summary might be useful.     Thanks PatchMyPC, the great and powerful program downloader and up...