Author Topic: Best Way To Transfer Files To The Z Over A Netwok  (Read 89028 times)

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Best Way To Transfer Files To The Z Over A Netwok
« Reply #45 on: February 25, 2007, 05:53:16 pm »
Quote
I think that what is most important is to have your ssh port down, or act as being down when not in use, so you escape from all those internet scanners.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155208\"][{POST_SNAPBACK}][/a][/div]

Note.. being "down" means dropping the request, not rejecting - rejecting will imply to hacker that there is something there but protected as they will get a response to their probe. Dropping means there'll be no response at all, so it will require them to sit and wait for timeout, and much harder to "fingerprint" the host.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Best Way To Transfer Files To The Z Over A Netwok
« Reply #46 on: March 04, 2007, 08:52:44 pm »
i have been fidiling with my config file to auto connect ot a diffrent port bassed on the host and it seems to work well, next is to set up a port knock approch, anyone know how to gett ssh to automate this or do i have to manually launch it every time i want to ssh in?
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Best Way To Transfer Files To The Z Over A Netwok
« Reply #47 on: March 05, 2007, 05:12:51 am »
Quote
i have been fidiling with my config file to auto connect ot a diffrent port bassed on the host and it seems to work well, next is to set up a port knock approch, anyone know how to gett ssh to automate this or do i have to manually launch it every time i want to ssh in?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155366\"][{POST_SNAPBACK}][/a][/div]

in your system firewall scripts, e.g. /etc/init.d/firewall, DONT permit ssh from everywhere, only from places you can always trust; simply DROP all ssh incoming... e.g.
    iptables -A INPUT -s 0/0 -p tcp --dport 22 -j LOG --log-prefix=" drop all ssh inbound"
    iptables -A INPUT -s 0/0 -j DROP

in the download tar.gz, there's scripts for opening up ssh when the appropriate ping is received; basically it looks like this
    iptables -I INPUT -s $PINGORIGIN -p  tcp --dport 22 -j ACCEPT

when the daemon times out the connection
    iptables -D INPUT -s $PINGORIGIN -p  tcp --dport 22 -j ACCEPT

you can add what you want to this script; e.g. to allow in http, proxy, imap-ssl or pop3-ssl. NOTE! this doesn't provide connectivity security, it's not a VPN (ok, you know this, but I wanted to remind you), so you still need to guard against someone on the local lan (especially wireless) sniffing for passwords and cookies!

the daemon writes to syslog too so you can see what's going on.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Best Way To Transfer Files To The Z Over A Netwok
« Reply #48 on: March 05, 2007, 05:19:47 am »
p.s. you also need to add the barricade startup script to /etc/init.d and put links in /etc/rc3.d and /etc/rc5.d
p.p.s. I would do an rpm but it's not really my package, I simply fixed up an existing program, and also it's really a one-off thing you'd set up, and to be useful requires so much customisation it'd be hard work to make an all-encompassing feature set!
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Best Way To Transfer Files To The Z Over A Netwok
« Reply #49 on: March 06, 2007, 03:17:19 am »
ne rpm is fine as its a debain server  however i was thinking more along the lines of the port knocker program that requires a port combonation to unlock and update the firewall for your host only
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Best Way To Transfer Files To The Z Over A Netwok
« Reply #50 on: March 06, 2007, 05:33:03 am »
Quote
ne rpm is fine as its a debain server  however i was thinking more along the lines of the port knocker program that requires a port combonation to unlock and update the firewall for your host only
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155518\"][{POST_SNAPBACK}][/a][/div]

you could adapt that program to listen on a range of tcp ports; or, just google for port knocking and download one of the other solutions and build it.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Best Way To Transfer Files To The Z Over A Netwok
« Reply #51 on: March 14, 2007, 06:39:30 pm »
I'm having issues again. I have been copying the id_dsa and id_dsa.pub files over each time I reflash my Z, but all of a sudden, it didn't work. I figured I'd just generate new keys, so I did. I copied the new id_dsa.pub file over to /home/user/.ssh/authorized_keys on my server and restarted sshd. I now try to login and it says "Permission denied (publickey)" I have id_dsa in /home/root/.ssh (I run as root). What is the issue? Before I would get a password prompt, but now it doesn't seem to recognize that the id_dsa file exists.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Best Way To Transfer Files To The Z Over A Netwok
« Reply #52 on: March 14, 2007, 07:22:26 pm »
check that the home directory and the .ssh directory are only writable by the person who should own them, i.e. no group+other write.

I alway do "chmod -R go= .ssh" when I've set things up.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Best Way To Transfer Files To The Z Over A Netwok
« Reply #53 on: March 14, 2007, 07:53:31 pm »
No joy. I have it set so I have read, write, and execute and group and other has only read on my Z and same except no read for group/other on the host. The same thing happens.

Any other ideas?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Best Way To Transfer Files To The Z Over A Netwok
« Reply #54 on: March 15, 2007, 01:14:55 am »
Quote
No joy. I have it set so I have read, write, and execute and group and other has only read on my Z and same except no read for group/other on the host. The same thing happens.
The files inside ~/.ssh needs to be rw for the user and nothing for group and other.
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Best Way To Transfer Files To The Z Over A Netwok
« Reply #55 on: March 15, 2007, 02:29:17 pm »
Still nothing.

I'm supposed to get a promp for the password of id_dsa whether it is being used or not, correct?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Best Way To Transfer Files To The Z Over A Netwok
« Reply #56 on: March 15, 2007, 06:53:07 pm »
use "ssh -v" and it should give you a hint. look at "dmesg | tail" or "tail /var/log/messages" or "tail /var/log/auth*" on the "receiving" machine.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Best Way To Transfer Files To The Z Over A Netwok
« Reply #57 on: March 15, 2007, 07:11:37 pm »
I don't see anything related to accepting or dropping a request.

I'm thinking it's an issue on the Z (client) end, as I'm using the same sshd_config that I was using and that worked.

Any other ideas?

Thanks for your help.

EDIT: I've been using the command

Code: [Select]
ssh -p xxx xxx.xxx.xxx.xxx
where xxx and xxx.xxx.xxx.xxx are replaced by the port and the host IP respectively.
« Last Edit: March 15, 2007, 07:13:08 pm by Capn_Fish »
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Best Way To Transfer Files To The Z Over A Netwok
« Reply #58 on: March 15, 2007, 07:36:50 pm »
Quote
EDIT: I've been using the command
Code: [Select]
ssh -p xxx xxx.xxx.xxx.xxx
Could you tell us what exactly you're trying to do? AFAICT you're trying to setup an automated ssh login (using keys), in which case the command you need is something like:

Code: [Select]
ssh -i ~/.ssh/some.key user@example.com
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Best Way To Transfer Files To The Z Over A Netwok
« Reply #59 on: March 15, 2007, 07:47:21 pm »
I am trying to get my setup back to the point where I have my Ubuntu server blocking all requests to ssh in except from the holder of the correct id_dsa file (my Z). I had it setup in this way and was using it to copy files between the server and my Z, but after reflashing my Z I can't get it to work again.

Basically, I'm trying to set up a secure ssh connection between my Z and an Ubuntu box using dsa keys for authentication.

Anything else you need to know?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo