Active Topics

 


Reply
Thread Tools
Posts: 62 | Thanked: 3 times | Joined on Feb 2006 @ Italy
#1
Hi, I'd like someone to explain me or point me on some written guide on how to do 2 things, or even one of them would be fine

1) I have dropbear working nice, but I start the connection entering as user, and then input the password I've setted on my 770 with passwd user. I'm using Putty on Windows, so I've generated the keys pair with PuttyGen and I've setted the private one in my Putty -> Connection -> SSH -> Auth. I've copied the public one as authorized_keys under home/user/.ssh/ and I've changed the permissions of the folder and the file. But, when connecting with Putty it says "Server refused our key" and I have to log in using the password. Can someone write how to use those keys as they are supposed to? Is it good to copy the public one into the file authorized_keys under home/user/.ssh ?

3) I have a bluetooth dongle on my PC and it is seen on the 770 (tested with hcitool scan). Could I use dropbear to establish a SSH connection through bluetooth rather than wi-fi? How?
 
Posts: 264 | Thanked: 28 times | Joined on May 2006
#2
1) Try renaming your authorized_keys file to authorized_keys2
Permissions should be 600

3) I don't know but wifi is better.
 
SeRi@lDiE's Avatar
Posts: 919 | Thanked: 37 times | Joined on Aug 2006 @ /dev/null
#3
3) Not Possible.
 

The Following User Says Thank You to SeRi@lDiE For This Useful Post:
Posts: 62 | Thanked: 3 times | Joined on Feb 2006 @ Italy
#4
Originally Posted by BanditRider
1) Try renaming your authorized_keys file to authorized_keys2
Permissions should be 600

3) I don't know but wifi is better.
Thanks, but renaming to authorized_keys2 doesn't change anything. Btw on the wiki it says to chmod the file to 400.

I'm not totally on the dir where to put the authorized_keys (or authorized_keys2) file: is it good "/home/user/.ssh/" ? Or it should be something under root?

Btw, is it too much bad to use the ssh connection with just the user password, I mean without this keypair thing? It works, but how much secure is it with a not so long alphanumeric user password? If it's enough, I can avoid the key check.

Both of you repliers have noticed that I've written "3" for the second question Well, let's put here a number 2:

2) How can I use PSCP (or PSFTP?) to transfer files back and forth between 770 and PC? Should I install something on the 770, or the dropbear server/client package on komputika repository is enough? I've tried from a cmd prompt in Windows XP the following command (the x's stand for something else):
Code:
C:\putty> pscp -pw xxxxxxxxxxxxxx c:\test_file.txt user@192.168.x.x:/home/user/test_file.txt
...and I get the error:
Code:
sh: /usr/lib/sftp-server: not found
Can you see what's wrong?
 
SeRi@lDiE's Avatar
Posts: 919 | Thanked: 37 times | Joined on Aug 2006 @ /dev/null
#5
You are better of with WinSCP is much simpler and the default settings in dropbear should work.
 
Posts: 264 | Thanked: 28 times | Joined on May 2006
#6
The authouized_keys2 file should be in /home/user/.ssh
my .ssh directory is mode 755 owner=user; group=users

All the files in the .ssh folder are mode 600 and owner=user; group=users

Code:
~/.ssh $ ls -la
drwxr-xr-x    2 user     users           0 Aug 24 16:33 .
drwxr-x---   18 user     users           0 Sep 14 12:33 ..
-rw-------    1 user     users         404 Jul  1 18:15 authorized_keys2
-rw-------    1 user     users         887 Jul  1 18:15 id_rsa
-rw-------    1 user     users         226 Jul  1 18:15 id_rsa.pub
-rw-------    1 user     users         395 Aug 24 16:33 known_hosts
~/.ssh $
I haven't used putty (or Windows) for a while but I remember something about an "agent" that handled the keys or passwords for encrypted keys.

The known_hosts file should be created the first time you try to connect to the 770.

I connect to the 770 using: ssh user@192.168.1.103
I've set up my router to assign that IP to the 770 based on it's MAC address so it's always the same.

scp is similar to yours but I don't give the destination filename, just the directory:
scp filename user@192.168.1.103:/media/mmc1
or whatever.

Last edited by BanditRider; 2006-09-15 at 21:51.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#7
1) shoud be something trivial (putty keys misconfiguration?)
Code:
~ $ ls -la .ssh/
drwx------    2 user     users        1024 Jul  9 10:01 .
drwxr-x---   21 user     users        1024 Sep  9 20:03 ..
-rw-------    1 user     users        1073 Jul  9 10:01 authorized_keys
-rw-r--r--    1 user     users         445 Jul  9 10:01 known_hosts
3) perrfectly possible, i'm using it with windows XP (widcomm bluetooth stack) over bluetooth too, XP is server with Network Access service enabled, n770 is client, should be possible in the other way too. Check bluetooth networking HOWTO in Maemo wiki for details

my bnep-up script
Code:
#!/bin/sh
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
        sudo gainroot <<EOF
$0 $*
EOF
        exit
fi
# real script follows
BTADDR='00:10:c6:24:05:a9'
IP=192.168.2.2
GW=192.168.2.1
NS=10.6.101.1
IFACE=bnep0

#insmod just to be sure
insmod /mnt/initfs/lib/modules/current/bnep.ko
#start PAN Bluetooth connection
pand --connect $BTADDR

# wait for the interface created by pand
s=60
echo -n "Waiting $s secs for $IFACE"
while [ $s -gt 0 ] ; do
        ifconfig $IFACE >/dev/null 2>&1 && break
        s=$((s-1))
        echo -n "."
        sleep 1
done
echo
if ifconfig $IFACE >/dev/null 2>&1 ; then
# bring it up
echo "OK, bringing $IFACE up"
ifconfig $IFACE $IP up
route add default gw $GW
echo "nameserver $NS" >/tmp/resolv.conf.lo
else
    echo "Error: $IFACE not available."
fi
 
Posts: 62 | Thanked: 3 times | Joined on Feb 2006 @ Italy
#8
No way, I don't know what I'm doing wrong. This is what I see on n770:
Code:
~ $ ls -la .ssh/
drwx------    2 user     users        0 Sep  18 19:35 .
drwxr-x---   18 user     users        0 Sep  10 22:57 ..
-rw-------    1 user     users        294 Sep  15 20:21 authorized_keys
-rw-r--r--    1 user     users         219 Jul  8 12:54 known_hosts
In Putty -> SSH -> Auth I make it point to the private key file (id_rsa.ppk) and again I have the connection working but it claims that server has refused our key, so it asks for the password and goes on.
I have re-generated the keys with puttygen just to make sure they're good, here they are:

This is the private key that I give to Putty:

Code:
PuTTY-User-Key-File-2: ssh-rsa
Encryption: aes256-cbc
Comment: rsa-key-20060915
Public-Lines: 4
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of some others scrambled chars...)
Private-Lines: 8
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of some others scrambled chars...)
Private-MAC: (40 scrambled numbers)
...and this is the authorized_keys file in the n770:

Code:
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20060915"
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of 64 scrambled chars...)
(line of some others scrambled chars...)
---- END SSH2 PUBLIC KEY ----

Last edited by insert_nick; 2006-09-18 at 17:16.
 
Posts: 264 | Thanked: 28 times | Joined on May 2006
#9
Did you provide a password when you generated your keys? ( I don't )
If so you'll need to enter that password each time you connect with ssh unless you run the putty agent which will handle that password for you.
 
Posts: 62 | Thanked: 3 times | Joined on Feb 2006 @ Italy
#10
Originally Posted by BanditRider
Did you provide a password when you generated your keys? ( I don't )
If so you'll need to enter that password each time you connect with ssh unless you run the putty agent which will handle that password for you.
Yes I provided a "passphrase", shouldn't I? Ok I'm going to try regenerating without it, thanks.
 
Reply


 
Forum Jump


All times are GMT. The time now is 20:23.