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

Saturday, December 10, 2022

ChatGPT

 I may need some notes for this . . .

ChatGPT

I asked it how to write a bat file to open command prompt with admin privilege's.
It said
@echo off
runas /user:Administrator /savecred cmd

(How much Googling would be needed for the same answer?) 

Or how about an AutoHotKey script?

Change pause to space when running COH only withing the COH program
;Replace the pause key with "space"

#IfWinActive ahk_exe RelicCOH.exe

Space::Send, {Pause}

#IfWinActive

. . . or

; Replace the pause key with the "space"

#IfWinActive ahk_exe YourProgram.exe

Pause::Space

#IfWinActive

To just replace pause with space in all programs
#space::pause


Pin Not Available

Crazy Error I had not seen before. Pin not available blah blah. I restarted a few times and it finally worked. If it doesn't some say to...