LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-27-2024, 12:09 PM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,366

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
sshd in Slackware - defaults?


I've got sshd for inefficient local file transfer, largely because I'm too lazy to set up vnc or some remote desktop protocol, and it's dead handy for the lazy or decepit to be able to issue commands on a remote box.

What are the defaults? All the lines in sshd_config are commented out, but I want to exclude anything not on my home network, and my home router aaa.bbb.ccc.1. How much of that is done by default?
 
Old 04-27-2024, 12:21 PM   #2
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 786

Rep: Reputation: 250Reputation: 250Reputation: 250
As I understand it, the commented out stuff is the default. If you want to change it, uncomment it and change it. sshd doesn't do host access control anymore, beyond ListenAddress. There was a time it linked in libwrap but no more. If you want to do better access control, run it under x/inetd and use the access control of those and/or libwrap. Other than that, that's always netfilter.
 
2 members found this post helpful.
Old 04-27-2024, 12:44 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,748

Rep: Reputation: 5926Reputation: 5926Reputation: 5926Reputation: 5926Reputation: 5926Reputation: 5926Reputation: 5926Reputation: 5926Reputation: 5926Reputation: 5926Reputation: 5926
If your not enabling ssh forwarding in your router then everything outside of your LAN will be excluded. You can also use the AllowUsers directive to limit your user only from your LAN or a specific address.

I don't think using ssh or sftp is being lazy. I rarely use remote desktop.
 
Old 04-27-2024, 12:57 PM   #4
viel
Member
 
Registered: Jul 2021
Location: Arcadia
Distribution: Slackware
Posts: 50

Rep: Reputation: Disabled
Maybe try to set up some rsa_id and use rsync over ssh.

 
1 members found this post helpful.
Old 04-27-2024, 01:21 PM   #5
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,818

Rep: Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494
Slackware links sshd against the tcp wrappers. Add this line in /etc/hosts.deny
Code:
sshd: ALL
If your local net is, for example, 192.168.1.0/24, add this to /etc/hosts.allow
Code:
sshd: 192.168.1. 127.0.0.1
 
5 members found this post helpful.
Old 04-27-2024, 02:04 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,366

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Quote:
Originally Posted by Petri Kaukasoina View Post
Slackware links sshd against the tcp wrappers. Add this line in /etc/hosts.deny
Code:
sshd: ALL
If your local net is, for example, 192.168.1.0/24, add this to /etc/hosts.allow
Code:
sshd: 192.168.1. 127.0.0.1
First, Thanks to all the fast & knowledgeable replies. If I condoned smoking in any way, @Petri Kaukasoina would get the cancer stick (Cigar). I'll go with solutions outside of X, because /etc/rc.d/rc.sshd is outside of X.
 
1 members found this post helpful.
Old 04-27-2024, 08:40 PM   #7
babydr
Member
 
Registered: Aug 2015
Location: Fairbanks , Alaska
Distribution: Slackware-14.2 & 15.0
Posts: 229

Rep: Reputation: 45
@business_kid & Rest , In slackware-15.0 the 192.168.1. can also be represented as 192.168.0.0/23 using a cidr mask or 192.168.0.0/255.255.254.0 which will allow the 192.168.0.x & 192.168.1.x range of ip addresses .

Hth , JimL

Quote:
Originally Posted by business_kid View Post
First, Thanks to all the fast & knowledgeable replies. If I condoned smoking in any way, @Petri Kaukasoina would get the cancer stick (Cigar). I'll go with solutions outside of X, because /etc/rc.d/rc.sshd is outside of X.
Code:
Slackware links sshd against the tcp wrappers. Add this line in /etc/hosts.deny
Code:

sshd: ALL

If your local net is, for example, 192.168.1.0/24, add this to /etc/hosts.allow
Code:

sshd: 192.168.1. 127.0.0.1
 
Old 04-27-2024, 09:26 PM   #8
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by business_kid View Post
I've got sshd for inefficient local file transfer, largely because I'm too lazy to set up vnc or some remote desktop protocol, and it's dead handy for the lazy or decepit to be able to issue commands on a remote box.
Are you using it just for file transfers? None of the options you've mentioned are ideal solutions for that. They'll do it, but there are better ways.

IMO, it'd be quickest & easiest to set up NFS shares if the 'client' boxes are running Linux. If they're not running Linux, then SAMBA is a little more fiddly to set up, but not overly so for a simple file share.

Another quick solution, if just for one-off transfers and the source files are on a Linux host, you could use the HTTP server Python module:

Code:
user@machine:/path/to/directory/containing/source/files$ python3 -m http.server
Then you can open a web browser on any other machine on the LAN, and enter the source machine's IP address, port 8000 eg: http://192.168.x.xx:8000
 
Old 04-28-2024, 07:45 AM   #9
Julius-Caesar
LQ Newbie
 
Registered: Nov 2014
Posts: 16

Rep: Reputation: Disabled
If you have SSH then you have SFTP

Code:
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.BAK

touch /etc/ssh/sshd_config

  Subsystem sftp /usr/libexec/sftp-server -R
-R puts the sftp-server into read-only mode. Attempts to open files for
writing, as well as other operations that change the state of the filesystem,
will be denied.

PD: I use this to access movie files stored on my PC from my FireTV stick with Kodi + sftp add-on

Last edited by Julius-Caesar; 04-28-2024 at 07:53 AM.
 
1 members found this post helpful.
Old 04-28-2024, 12:54 PM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,366

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
I evidently expressed myself poorly. Security isn't really a life or death issue. I'm usually behind a VPN, and have a full offline backup. The two pcs are a decent 6 core box and a RazPi 4B - throttled by poor design, using 4 A-72 cheapskate Arm cores and clocked at half the pc speed. Any hacker who has tried to get in is 100% expecting a windows box, so it's my son who will get nobbled . The LUG here is empty, just boring sysadmin nerds not used to mixing in company or sunlight.

I'm getting 1.5-2.0MB/S file transfers in ssh. Downloads can run ≤6MB as a rule, so that's a slow download. I'd like to better that, but I'm trying to position myself as a user, not a techie. So I'm not trying too hard.

@Julius-Caesar: SFTP still has the encryption/decryption stuff going on, which nobbles the RazPi. Thank you for the -r suggestion, but there can be 2 way traffic.

@rkelsen: That python http server trick was neat, and upped the speed to 4.5-5.0 MB/S. It also allowed me to stream stuff, which is good. With that and ssh, I needn't bother with elaborate efforts. All I have to do is leave the box on.
 
Old 04-28-2024, 09:41 PM   #11
arfon
Member
 
Registered: Apr 2004
Distribution: Slackware & RHEL
Posts: 376

Rep: Reputation: Disabled
Quote:
What are the defaults? All the lines in sshd_config are commented out
Here's my complete sshd_conf
Code:
Port 22
PermitRootLogin no
AuthorizedKeysFile	.ssh/authorized_keys
UsePAM yes
Subsystem	sftp	/usr/libexec/sftp-server

Quote:
Security isn't really a life or death issue. I'm usually behind a VPN, and have a full offline backup.
If you are inside your network and want speed, plain old FTP (without encryption) is much faster than ssh/sftp.


Quote:
Thank you for the -r suggestion, but there can be 2 way traffic.
^^^ I'm not sure of the context here but, I'll make an assumption.
You can use two rsync connections for 2way...

Or you could set up a Wireguard VPN and set up NFS.

Last edited by arfon; 04-28-2024 at 09:46 PM.
 
Old 04-28-2024, 10:00 PM   #12
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,691

Rep: Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377
For an absurdly long time I did similar things to share files on my local network, ssh, sftp, ftp, etc. I finally broke down last year and built a proper NAS and I wish I would have done it years ago. I built mine but you can use any older computer you got lying around. There are lots of good NAS operating systems options out there. TrueNAS, unraid, or openmediavault are popular. For simple setups I prefer openmediavault.
 
Old 04-28-2024, 10:16 PM   #13
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by business_kid View Post
@rkelsen: That python http server trick was neat, and upped the speed to 4.5-5.0 MB/S.
Setting up NFS is even easier. I don't know why you're bothering with anything else, particularly if you want to stream off it.
 
1 members found this post helpful.
Old 04-29-2024, 03:54 AM   #14
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,366

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Well, about 5MB is all I'm going to get from a 2.4Ghz wifi network in this crowded area anyhow. My tv sat down last night. The screen went, so I was had to jump for web playback. We have a superior range of superior tv available to us than the Excited States generally. I often had my brother (from NY, then Los Angeles) wistfully wishing for the tv he could get at home.

I'll put NFS on the to-do list.
 
Old 04-29-2024, 05:06 AM   #15
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by business_kid View Post
I'll put NFS on the to-do list.
This is the process at the server end:

1. edit /etc/exports to add the directories you want to share*
2. # chmod +x /etc/rc.d/rc.rpc
3. # /etc/rc.d/rc.rpc start
4. # chmod +x /etc/rc.d/rc.nfsd
5. # /etc/rc.d/rc.nfsd start

Client end:

# mount -t nfs 192.168.x.x:/mnt /mnt/hd

*A simple /etc/exports file, which exports the /mnt directory:

Code:
/mnt *(rw,no_root_squash,no_subtree_check)
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sshd rejects root with RSA key but sshd -d accept it yek Linux - Software 2 08-19-2015 11:15 AM
Starting sshd: /etc/init.d/sshd: line 113: /usr/sbin/sshd: Permission denied sumanc Linux - Server 5 03-28-2008 04:59 AM
FC4-Starting sshd: Privilege separation user sshd does not exist FAILED kiranherekar Fedora 5 12-29-2005 02:22 PM
Enabling SSH in mandrake 9.2 - sshd vs. sshd-xinetd DogTags Linux - Newbie 7 11-25-2003 12:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration