Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to transfer files from windows-box to linux-box
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Zu`
l33t
l33t


Joined: 26 May 2002
Posts: 716
Location: BE

PostPosted: Thu Aug 29, 2002 4:17 pm    Post subject: Reply with quote

JukkaR wrote:
Unfortunately, using Winscp, there's the same problem. When I enter the password, it just asks it again. But it doesn't log in.


If SSH works fine but SCP doesn't, check out this from the OpenSSH FAQ:

http://www.openssh.org/faq.html#2.9

See if this outputs anything:
Code:

ssh yourhost /usr/bin/true
Back to top
View user's profile Send private message
JukkaR
n00b
n00b


Joined: 02 Aug 2002
Posts: 61
Location: Finland

PostPosted: Thu Aug 29, 2002 4:41 pm    Post subject: Reply with quote

Zu` wrote:
JukkaR wrote:
Unfortunately, using Winscp, there's the same problem. When I enter the password, it just asks it again. But it doesn't log in.


So you can't login remotely using SSH?
Even not on the box itself?
Code:

ssh user@127.0.0.1


Nope. I cant login even in the box itself.
My /etc/hosts -file:
Code:
127.0.0.1          localhost
64.211.252.76        localhost.localdomain.com           localhost

Would there be something wrong in that file?
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Thu Aug 29, 2002 5:10 pm    Post subject: Reply with quote

Yes that file is wrong.

The 127.0.0.1 line is fine. The second line should resolve to what your actual resolvable machine name is. By that address I am understanding that your gentoo box has a static IP on the internet and is not behind a NAT router?

So an example would be:
Code:
64.211.252.75     machinename.mydomain.com     machinename
Back to top
View user's profile Send private message
kengu
n00b
n00b


Joined: 29 Aug 2002
Posts: 7
Location: Norway

PostPosted: Thu Aug 29, 2002 5:44 pm    Post subject: Hmmmm...... Reply with quote

wouldn't it just be easier to use FTP?
Back to top
View user's profile Send private message
n0n
Guru
Guru


Joined: 13 Jun 2002
Posts: 355

PostPosted: Thu Aug 29, 2002 5:53 pm    Post subject: Reply with quote

Possibly. You've still got to set up the FTP server, though, and FTP sends passwords in plaintext, which makes them very vulnerable to sniffing. And while that might not be a concern in this case (I don't know whether these machines are on a public network or not), I feel that it's a good idea to get into the "habit" of security early, so you don't have to re-learn things when it does become an issue.

That said, FTP certainly does have uses. I've got proftpd installed on my Gentoo box which I occasionally turn on so that my girlfriend can transfer some files from her Mac (os9) which I haven't tried to integrate any other way. I protect the port with iptables so that it's only accessible from her computer, and it's just an anonymous site, so there's no passwords sniffable anywhere.

That said, (*grin*) this is by far the most problems I've ever had setting up SSH. Typically I just install openssh and the client wherever it needs to go, and things just work. :)
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Thu Aug 29, 2002 8:07 pm    Post subject: Reply with quote

I think the fact that he cannot even ssh to his box should be the main focus now.

Please confirm that you have ssh running
Code:
ps auwwwx | grep sshd

should return a line like this
Code:
root      2797  0.0  0.1  2692 1016 ?        S    Aug17   0:02 /usr/sbin/sshd


What errors do you get when trying to ssh (not scp) to that box?
Back to top
View user's profile Send private message
scheuri
n00b
n00b


Joined: 21 Aug 2002
Posts: 22
Location: region basel, switzerland

PostPosted: Fri Aug 30, 2002 9:49 am    Post subject: Re: Hmmmm...... Reply with quote

kengu wrote:
wouldn't it just be easier to use FTP?


thanks kengu...
you jsut said what I thought first reading this thread... :wink:

honestly...as long as it is not necessary to encrypt the username/login and the content, why bothering with scp, ssh in general or something else than FTP?

first make your machine answering FTP-requests
then download a nice GUI for windows (Cute_ftp or WS_FTP) and then try to connect to the linux-machine...

my 2 rappen
scheuri
_________________
if someone finds any grammar errors...easy...keep them...:wink:
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Aug 30, 2002 12:29 pm    Post subject: Reply with quote

Mainly because of the fact that I don't think this kid has any clue about networking given the current state of affairs. So I would like to set him off on the right path with ssh/scp rather than the VERY insecure and VERY exploitable telnet and ftp.

Guessing from his previous post, I interpret that his linux box is indeed directly on the internet and so I would NEVER telnet/ftp to it. Especially now that he has posted his IP and any one of a million trolls is sniffing traffic as we speak.
Back to top
View user's profile Send private message
scheuri
n00b
n00b


Joined: 21 Aug 2002
Posts: 22
Location: region basel, switzerland

PostPosted: Fri Aug 30, 2002 12:36 pm    Post subject: Reply with quote

rizzo wrote:
... rather than the VERY insecure and VERY exploitable telnet and ftp.

Guessing from his previous post, I interpret that his linux box is indeed directly on the internet and so I would NEVER telnet/ftp to it. Especially now that he has posted his IP and any one of a million trolls is sniffing traffic as we speak.


(did some shortage with your quotes)

Well, okay...granted...though FTP would still be the easiest thing...however...you are right...under these circumstances better teach hin the right thing/way

I actually wasn't aware he was giving out his (fix?) IP-adresse (from his ISP?)....which indeed wouldn't be that fun (for him)....

anyway...still thinking of FTP...he might disconnect (physically) himself from the internet, open the FTP-port and then transfer his MP3, close the port again and then connect himself again to the internet...
just to give him the possibility to read som man's about ssh and scp while listening to music.... :wink:

my 2 rappen (which are cents in switzerland)
scheuri
_________________
if someone finds any grammar errors...easy...keep them...:wink:
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Aug 30, 2002 12:39 pm    Post subject: Reply with quote

Granted I don't _know_ for sure, but I'm assuming from his hosts file that he posted above.

I don't think FTP would be any easier than ssh/scp. I didn't have any trouble getting it going.
Code:
emerge openssh
rc-update add sshd default
/etc/init.d/sshd start

and I was golden. Jukkar do these steps in order again and tell me what output you get.
Back to top
View user's profile Send private message
JukkaR
n00b
n00b


Joined: 02 Aug 2002
Posts: 61
Location: Finland

PostPosted: Fri Aug 30, 2002 3:35 pm    Post subject: Reply with quote

First the problem was that there wasn't even sshd running on my machine. And the fact is that I don't know anything about these network issues. What there should be in the etc/hosts file below line "127.0.0.1 localhost"?
There's currently only mymachine.mydomain.com mymachine, since I dont know what IP-address there should be. And in pscp, is it correct when I type pscp file.txt root@mymachine.mydomain.com:/home ? Currently, I can login to my own box, typing ssh root@127.0.0.1 .
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Aug 30, 2002 3:39 pm    Post subject: Reply with quote

Alright I think we need more background.

I was under the impression that you have two machines. One is a windows machine, and the other is your new gentoo machine. I was also under the impression that both machines were directly connected to the internet, that both had real (i.e. resolving) IP addresses.

Please tell us how you are connected to the internet. DSL, Cable, dial-up? Do you have a router that shares the internet connection doing NAT?

This is not a problem with ssh at all. I would bet this bag of pretzels that I'm enjoying (honey mustard) that this is a network configuration problem and we'll do our best to educate you on such matters. Give us as much information as possible about your network setup and internet connection and we should be able to start.
Back to top
View user's profile Send private message
JukkaR
n00b
n00b


Joined: 02 Aug 2002
Posts: 61
Location: Finland

PostPosted: Fri Aug 30, 2002 3:54 pm    Post subject: Reply with quote

rizzo wrote:
Alright I think we need more background.

I was under the impression that you have two machines. One is a windows machine, and the other is your new gentoo machine. I was also under the impression that both machines were directly connected to the internet, that both had real (i.e. resolving) IP addresses.

Please tell us how you are connected to the internet. DSL, Cable, dial-up? Do you have a router that shares the internet connection doing NAT?

This is not a problem with ssh at all. I would bet this bag of pretzels that I'm enjoying (honey mustard) that this is a network configuration problem and we'll do our best to educate you on such matters. Give us as much information as possible about your network setup and internet connection and we should be able to start.


Three computers, they are all running Windows. (I've stolen one of the windows computer's network connection, because there's no more than three computers that can be connected to router.) Internet connection is shared for these three computers. So there's this kind of connection: In my computer (gentoo), there's network card (module=8139too, Realtek) that is connected to the router with those two windows computers. And the router is connected to Adsl modem. I could connect my computer and the windows computer (where the files are that need to be transfered) directly to each other (they are on same table). I don't know what is NAT ...

When I start samba, the windows-computer notices that theres "mymachine" online, type=samba server 2.2.5 . But when I double-click on the "mymachine", it asks for the passwd. But it won't accept it.

Typed pscp -v file.txt root@mymachine.mydomain.com:/home , and it tries to connect 216.148.221.139 port 22 - an IP-address that I haven't defined anywhere.
Back to top
View user's profile Send private message
n0n
Guru
Guru


Joined: 13 Jun 2002
Posts: 355

PostPosted: Fri Aug 30, 2002 4:08 pm    Post subject: Reply with quote

Okay, check this . . . On your Linux box, make sure networking works (ping some addresses, maybe visit a webpage or two). Then get your IP address ("ifconfig eth0" will tell you this, among many other ways). Then, on your windows box, do:
Code:
pscp a_file_in_my_current_directory.mp3 root@<ip-address>:/root


"mymachine.mydomain.com" is currently defined in /etc/hosts on the Linux box, this makes it only active on that Linux box. Just ignore it for now and use an IP address to see if that works. The reason why SAMBA is noticing "mymachine" is because of Samba setup. It doesn't make the "mymachine.mydomain.com" address resolvable via dns . . .
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Aug 30, 2002 4:11 pm    Post subject: Reply with quote

Alright then I'm going to assume that you have no idea what IP addresses are, and that you have been interacting with your windows boxes only through the Windows networking crap.

If you want to continue to do this, then samba could do that for you.

If you want to get off the porch and run with the big dogs, continue reading. I'm sure there are a million HOWTOs that explain things, but I'll try to be concise.

I'm assuming that your DSL provider (mine is SBC) gives you only 1 IP address. You need an IP address to be able to do anything on the internet. If you have more than one computer, you use a router to handle this IP address and share it via things like IP Masquerading and Network Address Translation (NAT). If you are interested read this

Now your computers behind the router also have IP addresses, but they have what are called non-resolving IP addresses. There are certain ranges of IP addresses that are reserved for intranet use. I think they are 10.*.*.*, 192.168.*.*, and 172.16.*.*. Someone correct me if I'm wrong. Now I'm willing to bet that your router is also DHCP server that is assigning your computers one of these addresses. What you need to know is what address it is assigning you.

So log into your linux box as root and type "ifconfig eth0" and find the "inet addr". That is your IP address for talking between each of your LAN machines. So if your IP is 192.168.0.2, then on your windows box you could type:
Code:
pscp -r mp3 root@192.168.0.2:

And that would move a directory named "mp3" to your gentoo box and put it in root's home directory (normally /root). NOTE that you need the colon ":" at the end of that line. pscp is nice and will just fail and give you a warning if you don't have it. scp on linux will actually copy the file to a file named root@192.168.0.2 if you don't have it.

Good luck and God speed.


Last edited by rizzo on Fri Aug 30, 2002 4:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
JukkaR
n00b
n00b


Joined: 02 Aug 2002
Posts: 61
Location: Finland

PostPosted: Fri Aug 30, 2002 4:12 pm    Post subject: Reply with quote

PROBLEM SOLVED!! Typed ifconfig eth0, took ip-address from there and entered it to pscp - now files are trasfered !! Thank you very much for your patience and help. I really appreciate that.
Edit: Files are not transferd, they are being transfered - it's over 12 gb's of them... It's going to take a while (almost 5h), since the network does only 700 kb/s.


Last edited by JukkaR on Fri Aug 30, 2002 4:36 pm; edited 2 times in total
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Aug 30, 2002 4:14 pm    Post subject: Reply with quote

Ah cool. Sorry if I dumbed it down too much, better safe than sorry.

Anyway like I said ssh/scp is the way to go. NEVER use telnet/ftp if you don't have to. And if you have to, then bitch about it until they put ssh on.
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7731
Location: Underworld

PostPosted: Fri Aug 30, 2002 4:37 pm    Post subject: disable ssh protocol 1 Reply with quote

It is also a good idea to disable Protocol 1 in SSHD... it is weak and somebody sniffing your network can get your password, I think. You can do that in /etc/ssh/sshd_config

Code:

Protocol 1,2


Change it to
Code:

Protocol 2


Don't forget to restart your ssh server.


rizzo wrote:
Ah cool. Sorry if I dumbed it down too much, better safe than sorry.

Anyway like I said ssh/scp is the way to go. NEVER use telnet/ftp if you don't have to. And if you have to, then bitch about it until they put ssh on.
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Aug 30, 2002 4:42 pm    Post subject: Reply with quote

Yes I agree I forgot about that. I only use protocol 2.

Thanks B
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum