Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

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, July 17, 2021

Windows 10 SSH Server (Dead To Me)

First PC was flawless but as usual this can be a pain . . . second machine did not accept password. Can't find a fix but . . . 
Good new is on Windows there are so many easy file sharing options you do not need a local Windows SSH Server.

Add the feature then start the service and set a firewall rule.

win+i > apps > apps&features > optional features > openssh server

Open Powershell command as Administrator
Type the following command to start the Service of the OpenSSH Server
Start-service sshd

I would leave as default service manual start but you can . . .
Type the following command to add Automatic Startup in Service
Set-Service -Name sshd -StartupType 'Automatic'

Type the following command to find the Rule for OpenSSH Server in Windows Firewall and verify that is Allow

Get-NetFirewallRule -Name *ssh*

I think this happens when ssh server is installed.
win > firewall & network protection > advanced settings

inbound rules > new rule > 
name = OpenSSH SSH Server (sshd)
description = Inbound rule for OpenSSH SSH Server (sshd)
Enabled
Allow the connection
Properties further allows settings restrictions but on a local network for simple files transfers and manual server on/off probably not needed

Friday, July 17, 2020

Linux SSH

*Be sure to turn off firewall or configure 22 to ssh on Linux.
SSH should be easy to set up but sometimes it is a pain.
 More Detail Here
Here is a bunch of good commands.
https://devconnected.com/how-to-install-and-enable-ssh-server-on-debian-10/

sudo apt-get install openssh-server


Now use 
... Putty
...... WinSCP
......... Or Windows 10 terminal "ssh ip address of Linux" I know, it's crazy.


/etc/init.d/ssh start
/etc/init.d/ssh stop
/etc/init.d/ssh restart

service ssh start
service ssh stop
service ssh restart

systemd
systemctl start ssh
systemctl stop ssh
systemctl restart ssh
systemctl enable ssh

Wednesday, May 20, 2020

Linux GUI Apps - SSH - Commands

#1. Find out which init system your Linux uses
init --version
#2. Find out your IP on the local network. You will need IP, user name, and password.
ifconfig (depricated and may not work because "net-tools" is not installed)
 use this instead
> > > ip a
On Windows use WinSCP to access the Linux server (I use portables via Symenu)

Terminal commands vary depending on if systemd or SysVinit. (Or some variation thereof)
Most all Linux versions have ssh service included. Verify by doing this.
ssh -V (check if installed)
The server is likely not installed so install it.
sudo apt install openssh-server -y

Verify if the service is running
sudo service ssh status
This is how to start the service
sudo service ssh start
or
sudo service ssh restart
Edit sudo nano /etc/ssh/ssh_config file and not the sshd_config (if it exists)
remove # on port 22
remove # on PasswordAuthentication yes
Check if server is running
ps aux | grep sshd
Check is server is listening on port 22
telnet localhost 22

***From here down needs editing. Maybe next time I set up a systemd.

... Start SSH
- In systemd
sudo systemctl start ssh
sudo systemctl start sshd (In arch)
... Check to see if enabled
sudo systemctl is-enabled ssh
sudo systemctl is-enabled sshd (In arch)
or
- In SysVinit (SystemV)

(check linux ip ifconfig)
Edit sudo nano /etc/ssh/ssh_config file and not the sshd_config
remove # on port 22
remove # on PasswordAuthentication yes
sudo systemctl restart sshd
sudo systemctl status sshd
use Putty and/or WinSCP 
ssh_config should look like this
check ip a
In WinSCP the connection is SCP not SSH

Obviously you use keys outside a closed network.


Should be able to install through apt-get
eg. sudo apt-get install hardinfo

Notes:
Update
sudo pacman -Syysudo
sudo pacman -Su

Find ip use "ip a"
ip route list
or install Nutty

Root file access in Manjaro
sudo thunar

OpenSSH on Arch
(Why care? Setting up VB using SSH in Windows for ease copy paste commands.)
sudo pacman -S openssh
sudo systemctl status sshd.service
sudo nano /etc/ssh/sshd.config
sudo systemctl enable sshd.service
sudo systemctl start sshd.service
(stop, restart, etc.)
On VM use bridged adapter for useful IP

... Then Putty on Windows should have access to (user-name@IP)

Good Links for ssh
https://linuxhint.com/ssh_virtualbox_guest/
http://www.tuxfixer.com/configure-ssh-service-in-manjaro-linux/
https://www.christitus.com/ssh-guide/

MX Linux does not use systemd so the systemctl commands don't work.
I have no idea how to restart ssd or do commands that use systemctl.
Commands
...This is one of the irritating things about Linux. Answers found online are often for a version you are not using. For instance alias
HowToGeek explains alias cls=clear
This is great but to make it survive a closed terminal he says add the command to the
... .bash_aliases file
,,,  but in Mint the file is /home/george/.bashrc
The List
alias
ps

Symenu Stuff (Irritating Updates)

I've used Symenu for ages and appreciate the broad selection of apps and the easy updating of those apps. The easy update days are over,...