I've been trying to set up SSH on my desktop and laptop, but the only sites I'm finding just says to simply do sudo apt-get install openssh-server, edit the config file, restart ssh and you are good to go. Anyone know of a site that tells it better? No site mentioned that it would ask for a password when logging into the other computer and says nothing about finding it out or anything.
You need the password to log onto the other computer just like you were sitting in front of it. If you don't have any accounts on the remote computer you're out of luck, as it should be.
Figured that out the first time it asked for a password. The sites I've found though just say to disable the password requirement (which obviously is a dumb idea), but not found anything about setting up the accounts to allow me to connect between the two. Like I said, all the sites I've found only showed to install the server and then how to edit the config file, but nothing about how to set up the accounts. That is why I asked if there was any better site as I've sifted through SSH tutorials and sites all day yesterday and last night.
I have two computers here, and I can ssh back and forth through a patch cable. The firewall on the remote machine (ipconfig stuff) has to allow it (ping the ip), I don't remember having to fiddle with /etc/hosts*, but that may be necessary too. I simply ssh to the other with the ip number (probably the account name too, it's been awhile, in my case "pepsi), and when it asks for a password (the password for the pepsi account on the other machine) I give it. If it wasn't done this way, everybody could hack into everybody else's box like it's done on other OS'es.
Yeah, the accounts are system level accounts. Use whatever username and password you usually use to login.
If I understand what you're asking, then SSH has nothing to do with the question you're asking for.
Thomas, thanks. See, none of the sites mentioned that, some sites had mentioned making keys and such for it after installing it, but none of them really showed what they were talking about. I've not used ssh before now, and really only messing with it right now out of boredom.
It's kind of obvious if you think about it.
It's kind of obvious if you think about it.
Not really, as the last site I went to after googling just mentioned creating accounts in order to log in to remote computers using ssh. It never covered making the accounts and I couldn't find a site that covered it which is why I asked here. I thought I had to create accounts on each computer for ssh to make it possible to log in, never occurred to me that it would just use the system log ins for that.
[REVISION]
Guess I should have just googled for how to copy files between the two with ssh. This site ( http://principialabs.com/beginning-ssh-on-ubuntu/ ) covered everything. The sites I read just showed the command to install and then went to talk about Public Key Authentication and making accounts to log into. Said to look for AllowUsers and add account names that are able to use ssh, but never covered just using the remote computer's login for it and didn't occur to me due to the fact that is said not to allow root login with ssh either.
If it didn't cover how to make the accounts, that implies it likely isn't an SSH feature. Then you can logically deduce that maybe, it would be some other account system that takes care of it. And which account system would make the most sense for ssh to be tied into?
It's not completely obvious. Many vnc servers for example just require a password and log you into whatever account started the server. But yeah, every task on a unix machine is run by some user, so you always need some account to do anything. Well same can be said for Windows, Mac and anything else nowadays. You always need an account.
If it didn't cover how to make the accounts, that implies it likely isn't an SSH feature. Then you can logically deduce that maybe, it would be some other account system that takes care of it.
No, like I said, most of the sites were geared towards just installing ssh and would just say the commands to install, how to edit the config file, restart ssh. A few just ended there and some would recommend putty and just mention making accounts and public key authentication. Seemed like they were only geared toward installing it and not anything else, so therefore you can't deduce anything from it thanks to how the internet is (I mean look at tutorials on youtube, some are just show you where to download things and how to install them in the first video and save the other details for later videos).
I think you just don't know how to think logically If it doesn't say how, and you can't think of how, you should immediately search for the solution.
I did and that is when I started finding things about log in and make a call to ssh-keygen -t dsa that was what I kept finding when I did a google search for "Ubuntu ssh login denied" or something along those parameters. The sites I found said to log in and started going through that, but never explained why the log in was denied. I didn't think I had to use the system login, I thought I would have to make a login that I would have to approve on each ssh config (mainly due to finding the AllowUsers <username> on one site) so I just logically figured the secure part of the ssh was that it made a read only connection between the computers, but couldn't figure out how to make the accounts register because my config file didn't have an AllowUsers option.
My favourite feature on Ubuntu is that you have ssh in nautilus out of the box.
Just point it to your account on another computer and you can use it as if you worked with local folders. sftp://account@ipordomain/home/account
Then you can right click in that folder and start a remote terminal if you need to do command line stuff on that computer.
I've been fighting that myself right now. I have both the desktop and laptop set to port 5698 and I can connect with ssh and putty, but I can't get any ftp clients to connect to it and scp doesn't seem to work for getting my files off my desktop to my laptop :/. Googling revealed Filezilla and gFTP but both of them say can't resolve host even though I could connect to my desktop with the other methods. Google is offering up tons of solutions, none of which appear to work.
Are you trying FTP or SFTP. FTP may not be set up but SFTP works over the same connection as SSH so it would be. Try connecting with a url like this: sftp://<ip> on whatever port ssh is on.
gFTP has an option to use SSH2, but it was still saying it couldn't resolve host even though I was able to use putty to log into my desktop. I'll keep looking into it though. As for sftp:// it says there is no program installed for that protocol when I type it in.
[REVISION]
Got it working. Apparently, my router is just a p.o.s. and picky as to when it works. My desktop worked fine, but laptop fought it a little.
Have you tried scp? It's basically the cp command, but over ssh. E.g., to copy an entire directory 'foobar' from host 'baz' to you local machine, you'd say scp -r specter@foobar:baz ./baz. No need to mount anything or go through one of those clumsy file managers
Yeah, I said scp didn't work a few posts in. Turned out that I had to instal vsftpd onto my computers to get the FTP to work. Copied all my files and working between the two computers now.
As long as ssh works, scp works.
Apparently not. I was able to ssh to both computers and look at the drives, but when I did scp it said it couldn't find the host on both. After installing vsftpd I was able to use Filezilla to transfer the files, but scp still keeps saying no host found. At least I got filezilla working so I can work between the two. Just copied some projects over to my laptop because I'm going to do a few competitions (well I may just do Moosader's competition that ends Oct 29).
As long as ssh works, scp works.
That was my impression, too. But then, this is Ubuntu we're talking about here
That was my impression, too. But then, this is Ubuntu we're talking about here
We are talking about Specter here I think he just mis-typed the command. scp doesn't use the same command format that ssh does.
Here is a copy/paste of the command I was using:
scp -r cptvile@192.168.1.103:/Projects /
I just copied and pasted this "scp -r remoteuser@remotebox:/remote/directory local/directory" from http://principialabs.com/beginning-ssh-on-ubuntu and still got no route to host, but could use ssh and putty both to connect with no problem.
No route to host means the ip you used was wrong.
Also: /Projects? Why would you put your Projects directory directly under the filesystem root? Put it in ~/Projects, or /usr/local/share/Projects if you have to, but for all that's sacred, don't ever put anything directly under /. Really.
The ip isn't wrong, did ifconfig on it to find it. Desktop was 192.168.1.103 and laptop was 192.168.1.104 (laptop usually jumps between 104 and 102) due to hibernating, but PC stays on 24/7 and hasn't changed in months.
Can you ping it?
Can you ping it?
Are you serious? If I can connect with SSH and use filezilla after installing vsftpd, but only have issues with scp saying no route to host, then obviously ping would work otherwise the other two wouldn't work either.
scp uses the same ssh code as the ssh program. you had to have mistyped the ip.
No, still having issues with it saying no route to host. Though, now it is only doing it for directories, but allowing me to copy individual files between the two.
One terminal:
Last login: Mon Oct 8 15:10:12 2012 from clay-laptop.local
cptvile@clay-PC:~$ ls
7-uothzTaaQ.mp4 Dropbox pong Sublime Text 2
allegro-5.0 examples.desktop projects Templates
allegro-5.1.2 git Public test.db
android-sdk-linux incoming_fart.mp3 SDL-1.2.15 troll
artest kdenlive SDL-2.0.0-6302 tutor
artest.cpp libtheora-1.1.1 sdl3.cpp Ubuntu One
Charred Dirt lmms sdlsprite.cpp Videos
Desktop lua-5.2.0 SFML-1.6 workspace
dlg Music SFML-2.0-rc
Documents nmap-6.00 sqlite-autoconf-3071300
Downloads Pictures sshd_config
Second Terminal:
equinox@Clay-Laptop:~$ scp cptvile@192.168.1.103:~/artest.cpp /home/equinox/
cptvile@192.168.1.103's password:
artest.cpp 100% 187 0.2KB/s 00:00
Third Terminal:
equinox@Clay-Laptop:~$ scp -r cptvile@192.168.1.103:~/Projects /home/equinox/
ssh: connect to host 192.168.1.103 port 22: No route to host
Only thing I can think of is possibly router just acting up .
I can say its not scp's fault. Networking issue of some kind. Means that the kernel can't figure out how to send packets to that address (generally there's a "default" route setup to send all packets out a specific interface to a specific address for further "routing"). Check and see if your lan (not internet) connection is dropping right around the same time. Try running a ping at the same time (from the same computer, to the same computer) you're trying to use scp. See what ping says about it.
Yeah, ping is timing out when I try to do directory transfers. Ran to the local Best Buy and got a router and seems to work. The other router was majorly old, had it before 2006 I believe.