[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#655230: ITP: pushkey -- ITP: pushkey - Pushes your ssh key to a remote location. It tries to create a .ssh folder remotley then it adds your ssh key to authorized_keys.



On Mon, Jan 09, 2012 at 07:43:27PM -0500, Al wrote:
> This might seem trivial but it helped enough people I work with that I thought
> I should contribute the code. Instead of running "ssh-copy-id -i identityName
> IPADDR" , all you had to do was "pushkey IPADDR". The difference between my
> package and ssh-copy-id is that my package sets the permission on the folder
> and file and it also gives you the option to create new ssh key keys if it
> doesn't find it. ssh-copy-id does not have the ability to create the .ssh
> folder remotely nor does it change the permissions. And you had to explicitly
> specify which key to use in ssh-copy-id. I use pushkey on many other distro's
> too so I thought it might be something beneficial that can be ported over
> easily. 

Actually, ssh-copy-id does create the .ssh directory on the other end,
and sets its permission and the permission of the authorized_keys file
it creates. See this session:

    liw@havelock$ ssh -l tomjon localhost
    tomjon@localhost's password: 
    Linux havelock 3.1.0-1-amd64 #1 SMP Sun Dec 11 20:36:41 UTC 2011 x86_64
    tomjon@havelock:~$ ls -ld .ssh
    ls: cannot access .ssh: No such file or directory
    tomjon@havelock:~$ logout
    Connection to localhost closed.
    [status 2]
    liw@havelock$ ssh-copy-id tomjon@localhost
    tomjon@localhost's password: 
    Now try logging into the machine, with "ssh 'tomjon@localhost'", and check in:

      ~/.ssh/authorized_keys

    to make sure we haven't added extra keys that you weren't expecting.

    liw@havelock$ ssh -l tomjon localhost
    Linux havelock 3.1.0-1-amd64 #1 SMP Sun Dec 11 20:36:41 UTC 2011 x86_64
    Last login: Tue Jan 10 01:01:32 2012 from localhost
    tomjon@havelock:~$ ls -la .ssh
    total 12
    drwx------ 2 tomjon tomjon 4096 tammi 10 01:01 .
    drwxr-xr-x 3 tomjon tomjon 4096 tammi 10 01:01 ..
    -rw------- 1 tomjon tomjon  385 tammi 10 01:01 authorized_keys
    tomjon@havelock:~$ 

ssh-copy-id does not create keys, it is true.

-- 
Freedom-based blog/wiki/web hosting: http://www.branchable.com/

Attachment: signature.asc
Description: Digital signature


Reply to: