Page 1 of 1

crossover cable LAN connection and mc?

Posted: 22 Jul 2019, 13:34
by Rava
I know that mc has some basic net abilities.

Now my question, connecting two Porteus machines via a crossover cable LAN cable will not work as a connection out of the box.

At least not with Porteus 3.1 on the i586 machine, and 5.0rc1 on the x86-64 able machine.

I wonder, would it be possible to get a crossover cable LAN connection via mc?

In case anyone might wonder what a crossover cable LAN cable is: it looks like your run of the mill LAN cable, but its small cables are connected differently, so that you can connect two machines with each other just by plugging in this special LAN cable without the need of a router.


CAVE! EDIT!
I edited my original post and replaced the incorrect used term with the one ncmprhnsbl told me about below, also edited the title.

"Null-Modem" LAN connection and mc?

Posted: 22 Jul 2019, 22:34
by ncmprhnsbl
"crossover cable" is the term i think you"re looking for
Crossover cables look identical to straight-through cables, but have several wire pairs reversed at one end,
possible(or not) useful info:

"Null-Modem" LAN connection and mc?

Posted: 23 Jul 2019, 03:43
by Ed_P
Walmart sells a 10' Crossover Cable for $6.45.

If you have a standard piece of cable and some RJ45 plugs you could make your own.

https://www.google.com/search?q=crossov ... =iu&ictx=1

crossover cable LAN connection and mc?

Posted: 23 Jul 2019, 23:08
by Rava
ncmprhnsbl wrote:
22 Jul 2019, 22:34
"crossover cable" is the term i think you"re looking for
Crossover cables look identical to straight-through cables, but have several wire pairs reversed at one end,
Indeed, and thanks for the heads up. I edited my above post accordingly.
ncmprhnsbl wrote:
22 Jul 2019, 22:34
possible(or not) useful info:
I will check that out and give you the heads up, but not now. We have the witching hour and I need to sleep. :)

crossover cable LAN connection and mc?

Posted: 26 Jul 2019, 20:43
by Rava
Since the configuration like in https://superuser.com/questions/279543/ ... ross-cable about "I connected two Fedora machines. Here, I used A and B as the machine names" does not work in Slackware / Porteus, I tried doing it like the original question, but only added one route to the other machine and not one back.

This is on PC 1 - the one running Porteus 5.1rc1 x86-64:

Code: Select all

root@porteus:~# ifconfig eth0 10.10.11.16 netmask 255.255.255.0 up
root@porteus:~# route add default gw 10.10.11.13 eth0
root@porteus:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.10.11.13     0.0.0.0         UG    0      0        0 eth0
10.10.11.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
loopback        0.0.0.0         255.0.0.0       U     0      0        0 lo
root@porteus:~# ping 10.10.11.13
PING 10.10.11.13 (10.10.11.13) 56(84) bytes of data.
From 10.10.11.16 icmp_seq=1 Destination Host Unreachable
From 10.10.11.16 icmp_seq=2 Destination Host Unreachable
From 10.10.11.16 icmp_seq=3 Destination Host Unreachable
^C
--- 10.10.11.13 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4078ms
pipe 4
root@porteus:~#
Then I switched to PC 2 - the one running i586 Porteus 3.1:

Code: Select all

guest@porteus:~$ su -
Password: 
root@porteus:~# ifconfig eth0 10.10.11.13 netmask 255.255.255.0 up
root@porteus:~# ping 10.10.11.16
connect: Network is unreachable
root@porteus:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
loopback        *               255.0.0.0       U     0      0        0 lo
root@porteus:~# ifconfig eth0 10.10.11.13 netmask 255.255.255.0 up
root@porteus:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.10.11.0      *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
root@porteus:~# ping 10.10.11.13
PING 10.10.11.13 (10.10.11.13) 56(84) bytes of data.
64 bytes from 10.10.11.13: icmp_seq=1 ttl=64 time=0.058 ms
64 bytes from 10.10.11.13: icmp_seq=2 ttl=64 time=0.067 ms
64 bytes from 10.10.11.13: icmp_seq=3 ttl=64 time=0.066 ms
64 bytes from 10.10.11.13: icmp_seq=4 ttl=64 time=0.064 ms
^C
--- 10.10.11.13 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.058/0.063/0.067/0.010 ms
root@porteus:~# ping 10.10.11.13
connect: Network is unreachable
root@porteus:~# ifconfig eth0 10.10.11.13 netmask 255.255.255.0 up
root@porteus:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.10.11.0      *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
root@porteus:~# ifconfig eth0 10.10.11.13 netmask 255.255.255.0 up
root@porteus:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.10.11.0      *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
root@porteus:~# ping 10.10.11.13
PING 10.10.11.13 (10.10.11.13) 56(84) bytes of data.
64 bytes from 10.10.11.13: icmp_seq=1 ttl=64 time=0.051 ms
64 bytes from 10.10.11.13: icmp_seq=2 ttl=64 time=0.069 ms
64 bytes from 10.10.11.13: icmp_seq=3 ttl=64 time=0.062 ms
^C
--- 10.10.11.13 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.051/0.060/0.069/0.011 ms
root@porteus:~# ping 10.10.11.13
connect: Network is unreachable
root@porteus:~# 
After the ping worked on PC 2 I again did ping on PC 1 once again:

Code: Select all

root@porteus:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.10.11.13     0.0.0.0         UG    0      0        0 eth0
10.10.11.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
loopback        0.0.0.0         255.0.0.0       U     0      0        0 lo
root@porteus:~# ping 10.10.11.13
PING 10.10.11.13 (10.10.11.13) 56(84) bytes of data.
64 bytes from 10.10.11.13: icmp_seq=1 ttl=64 time=0.621 ms
64 bytes from 10.10.11.13: icmp_seq=2 ttl=64 time=0.361 ms
64 bytes from 10.10.11.13: icmp_seq=3 ttl=64 time=0.322 ms
64 bytes from 10.10.11.13: icmp_seq=4 ttl=64 time=0.299 ms
64 bytes from 10.10.11.13: icmp_seq=5 ttl=64 time=0.268 ms
64 bytes from 10.10.11.13: icmp_seq=6 ttl=64 time=0.235 ms
64 bytes from 10.10.11.13: icmp_seq=7 ttl=64 time=0.353 ms
64 bytes from 10.10.11.13: icmp_seq=8 ttl=64 time=0.333 ms
64 bytes from 10.10.11.13: icmp_seq=9 ttl=64 time=0.339 ms
64 bytes from 10.10.11.13: icmp_seq=10 ttl=64 time=0.329 ms
64 bytes from 10.10.11.13: icmp_seq=11 ttl=64 time=0.400 ms
64 bytes from 10.10.11.13: icmp_seq=12 ttl=64 time=0.352 ms
^C
--- 10.10.11.13 ping statistics ---
12 packets transmitted, 12 received, 0% packet loss, time 11299ms
rtt min/avg/max/mdev = 0.235/0.351/0.621/0.091 ms
root@porteus:~# ping 10.10.11.13
PING 10.10.11.13 (10.10.11.13) 56(84) bytes of data.
^C
--- 10.10.11.13 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2088ms

You can see, for a short time a connection - at least via ping - is available, but that breaks down after a short time.
Any ideas why that is?

I presume to have a stable connection and be able to send files via LAN cross cable - I would at least have to install a minimal ftp server on one of the Porteus machines?
When I want to send files in both directions, would I need to install a ftp server on both machines?

crossover cable LAN connection and mc?

Posted: 27 Jul 2019, 08:28
by Blaze
Rava, simple way is share your stuff via samba - look at this topic Установка и настройка Samba - общий доступ к сетевым дискам
If you want to use FTP-server look at Установка и настройка FTP-сервера VSFTPD в Porteus or Установка и настройка FTP-сервера ProFTPD в Porteus
At my job I use samba for the local connection and VSFTPD for the global connection via canonical domain from provider.

crossover cable LAN connection and mc?

Posted: 27 Jul 2019, 18:02
by Rava
Blaze wrote:
27 Jul 2019, 08:28
If you want to use FTP-server look at Установка и настройка FTP-сервера VSFTPD в Porteus
So, your module vsftpd-3.0.3-x86_64-5.xzm would work for Port 5.0rc1?

It said in your post "(для Porteus 4.0+)", I presume that means "for Porteus 4.0+"

I think I try out VSFTPD - 64kB only, I am sure Samba would be much larger than that. And Samba is mainly WitlessOS sharing, and I have no interest in that. Linux only sharing is all I need.

Would I need to run VSFTPD on both machines? (Sadly, I still cannot read Russian.)

Therefore I looked up other resources, like https://help.ubuntu.com/community/vsftpd
Seems that page is outdated when it comes to the most recent version:
The latest vsftpd release is v3.0.2, currently at https://security.appspot.com/downloads/ ... 0.2.tar.gz
but seems informative nonetheless.

BUT the site fails to tell us which file needs to be edited.
E.g. it states
To disable anonymous login and to enable local users login and give them write permissions:

Code:
# No anonymous login
anonymous_enable=NO
# Let local users login
# If you connect from the internet with local users, you should enable TLS/SSL/FTPS
local_enable=YES
# Write permissions
write_enable=YES
That is all peachy, but where to put these lines?

crossover cable LAN connection and mc?

Posted: 27 Jul 2019, 20:18
by Blaze
Rava wrote:
27 Jul 2019, 18:02
So, your module vsftpd-3.0.3-x86_64-5.xzm would work for Port 5.0rc1?
of course. Porteus 4.0+ is mean Porteus 5.0

Samba is included to core of Porteus =)
Rava wrote:
27 Jul 2019, 18:02
Would I need to run VSFTPD on both machines?
no. Only at one PC (as server).
Another machines - as clients. For connetion to FTP server you can use gFTP client for example.

Rava, I have done all settings in vsftpd-3.0.3-x86_64-5.xzm

but you are need to set these parameters

Code: Select all

# Enable passive mode for vsftpd server
# Specify port range for passive mode
pasv_enable=Yes
pasv_max_port=<max>
pasv_min_port=<min>

# Set to YES if you want to use the host name (as opposed to the IP address) in the pasv_address option
pasv_addr_resolve=NO
pasv_address=<your ip>
after this run these commands

Code: Select all

# Note. You can use different path instead /home/ftp and different user name
useradd -d /home/ftp -m -g users -s /dev/null ftpuser
passwd ftpuser
chmod -R 775 /home/ftp
chown -R ftpuser:users /home/ftp
echo 'ftpuser' > /etc/vsftpd.allow_list
echo -e "if [ -x /usr/sbin/vsftpd ]; then\\n  echo \"Starting vsftpd: /usr/sbin/vsftpd\" && sleep 5 && /usr/sbin/vsftpd &\\nfi" >> /etc/rc.d/rc.local
reboot
and test ftp://localhost/ at the FTP server.

On client machine run gFTP and type
  • ip of your FTP server
  • port - type 21 in this field
  • user name
  • password

crossover cable LAN connection and mc?

Posted: 28 Jul 2019, 09:48
by Rava
Blaze wrote:
27 Jul 2019, 20:18
no. Only at one PC (as server).
Another machines - as clients. For connetion to FTP server you can use gFTP client for example.
Okay, since ftp should be able to handle both uploads and downloads, it should be possible to upload stuff from any of the PCs, and also possible to download stuff to any, right?
Blaze wrote:
27 Jul 2019, 20:18
Rava, I have done all settings in vsftpd-3.0.3-x86_64-5.xzm

but you are need to set these parameters

Code: Select all

# Enable passive mode for vsftpd server
# Specify port range for passive mode
pasv_enable=Yes
pasv_max_port=<max>
pasv_min_port=<min>

# Set to YES if you want to use the host name (as opposed to the IP address) in the pasv_address option
pasv_addr_resolve=NO
pasv_address=<your ip>
I presume these should be set in /etc/vsftpd.conf ?

And since I run my systems without any save container (I prefer manual savings to $PORTDIR/rootcopy ) I presume I need to copy /etc/vsftpd.conf to $PORTDIR/rootcopy/etc also prior reboot.
And also the changes done by the other commands, like what useradd and passwd did.

Or, as added security, create a new local version of the vsftpd module including these changes, with the changed /home/ftp folder and also including changed /etc/shadow /etc/passwd /etc/vsftpd.conf /etc/vsftpd.allow_list and /etc/rc.d/rc.local .
Am I missing crucial files or folders here?

You put Russian comments into /etc/vsftpd.conf of the vsftpd-3.0.3-x86_64-5.xzm module.
I downloaded the original vsftpd-3.0.3-x86_64-5.txz to get the man pages and looked up the info.
The translation to these:

Code: Select all

# Эта опция имеет эффект только для не-PAM сборок vsftpd.
# Если выключена, то vsftpd не будет проверять оболочку локального пользователя в /etc/she
lls
check_shell=NO

# Директива, разрешающая список пользователей которым нужно открыть доступ к FTP, и путь до этого списка соответственно.
userlist_enable=YES
userlist_file=/etc/vsftpd.allow_list

# Директива, запрещающая список пользователей, которым закрыт доступ к FTP,
# в нашем случае запрещен вход всех пользователей кроме тех что указаны в /etc/vsftpd.allow_list
userlist_deny=NO
should be these (as taken from /usr/man/man5/vsftpd.conf.5 ):

Code: Select all

# Note!  This option only has an effect for non-PAM builds of vsftpd.
# If disabled, vsftpd will not check /etc/shells  for  a  valid  user shell 
# for local logins. Default: YES
check_shell=NO

# If enabled, vsftpd will load a list of usernames, from the filename
# given by userlist_file.  If a user tries to log in using a name  in
# this  file,  they  will be denied before they are asked for a pass‐
# word. This may be useful in preventing  cleartext  passwords  being
# transmitted. See also userlist_deny.  Default: NO
userlist_enable=YES
userlist_file=/etc/vsftpd.allow_list

# This option is examined if userlist_enable is activated. If you set
# this setting to NO, then users will be denied login unless they are
# explicitly listed in the file specified by userlist_file.  When lo‐
# gin is denied, the denial is issued before the user is asked for  a
# password.   Default: YES
userlist_deny=NO
Can you provide a translation to these two Russian lines:

Code: Select all

#«запирать» локальных пользователей в домашнем каталоге
chroot_local_user=YES
# разрешаем использовать домашние каталоги с правом на запись
allow_writeable_chroot=YES
I did not find any allow_writeable_chroot in all of /man/man5/vsftpd.conf.5 of the original txz!

When starting gftp it gives these warnings:

Code: Select all

$ gftp
gFTP Warning: Skipping line 248 in config file: entropy_source
gFTP Warning: Skipping line 251 in config file: entropy_len
gFTP Warning: Skipping line 254 in config file: verify_ssl_peer
is any of that vital?
Not having ssl is probably a bad idea, and usually entropy here is used for more security.

crossover cable LAN connection and mc?

Posted: 28 Jul 2019, 14:32
by Blaze
Rava wrote:
28 Jul 2019, 09:48
Okay, since ftp should be able to handle both uploads and downloads, it should be possible to upload stuff from any of the PCs, and also possible to download stuff to any, right?
Yes.
Rava wrote:
28 Jul 2019, 09:48
I presume these should be set in /etc/vsftpd.conf ?
Yep.
Rava wrote:
28 Jul 2019, 09:48
Am I missing crucial files or folders here?
Seems all files and folders are here, but I Porteus use with save changes.
Rava wrote:
28 Jul 2019, 09:48
Can you provide a translation to these two Russian lines:

Code: Select all

# This rule assigns virtual root to the global users, that connects from Internet (via external ip or domain).
# so that users do not have access to move beyond their virtual root (directory)
chroot_local_user=YES
# Able to be writable to the chroot environment 
allow_writeable_chroot=YES
Rava wrote:
28 Jul 2019, 09:48
When starting gftp it gives these warnings:
I don't have these warnings in terminal. In gFTP

Code: Select all

Searh mydomain.ru
Attempt mydomain.ru:21
Connect to mydomain.ru:21
220 (vsFTPd 3.0.3)
USER myuser
331 Please specify the password.
PASS xxxx
230 Login successful.
SYST
215 UNIX Type: L8
TYPE I
200 Switching to Binary mode.
Pwd
257 "/" is the current directory
Downloading the list of directory files from the server (LC_TIME = ru_RU.utf8)
PASV
227 Entering Passive Mode (XXX,XXX,XXX,XX,39,108).
LIST -aL
150 Here comes the directory listing.
226 Directory send OK.

crossover cable LAN connection and mc?

Posted: 29 Jul 2019, 22:40
by Rava
Blaze wrote:
28 Jul 2019, 14:32
Rava wrote:
28 Jul 2019, 09:48
Can you provide a translation to these two Russian lines:

Code: Select all

# This rule assigns virtual root to the global users, that connects from Internet (via external ip or domain).
# so that users do not have access to move beyond their virtual root (directory)
chroot_local_user=YES
# Able to be writable to the chroot environment 
allow_writeable_chroot=YES
Thanks, updated my localized module.