ssh configuration ? (doesn' work)[Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

ssh configuration ? (doesn' work)[Solved]

Postby fjkhf » Wed Jan 01, 2014 13:11

Hello and I wish you a happy new year!

I want to use rsynch with ssh between 2 pcs on my lan.

I did:
Code: Select all
/etc/init.d/sshd restart

and I edited :
Code: Select all
/etc/ssh/sshd_config

in order to enable
Code: Select all
Port 22



Is there sth else to be done? (I have installed on both pc2 openssh)

I am trying :
Code: Select all
rsync -avzhe ssh /home/user1/temp/ [email protected]:/home/user2/temp/


Here :
Code: Select all
[email protected]
should I have user2 or the name of pc? (work-pc)

Thanks!
Last edited by fjkhf on Sat Jan 04, 2014 11:28, edited 1 time in total.
fjkhf
Simple Hen
 
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: ssh configuration ? (doesn' work)

Postby Cb7 » Wed Jan 01, 2014 14:54

Editing /etc/ssh/sshd_config does not “enable” port. That's firewall's job. What you can do with it, is to tell SSH on which port listen for incoming connections.
If you're using OpenRC it should work, except for part I'm not sure about, which is rsync -avzhe ssh . Perhaps better would be:
Code: Select all
rsync -avh -e 'ssh -i keyfile' /local [email protected]:/remote
As you've noticed, there's no -z, since there's no need for it on LAN (it only would slow down things, unless you don't have even 10 Mb/s of bandwidth on LAN…).

Note that your command will require to enter password every time. Better way would be to authenticate using keys.
Why, and how to add "[Solved]" to your post. Please read. ← credits to Fitzcarraldo

Kind regards
~Zetok Zalbavar
Cb7
Growing Hen
 
Posts: 104
Joined: Sun Apr 07, 2013 7:13


Re: ssh configuration ? (doesn' work)

Postby sabayonino » Thu Jan 02, 2014 19:41

Hi

Is ssh daemon running ? (and starting its service at boot...)

For OpenRc
Code: Select all
# /etc/init.d/sshd start && rc-update add sshd default


For Systemd (Default from scratch)
Code: Select all
# systemctl start sshd.service && systemctl enable sshd.service


:roll:
User avatar
sabayonino
Sagely Hen
 
Posts: 2679
Joined: Sun Sep 21, 2008 1:12
Location: Italy

Re: ssh configuration ? (doesn' work)

Postby Honeyman » Fri Jan 03, 2014 0:29



For copying your SSH-key onto the other machine you need to specity the location of your key:

Code: Select all
ssh-copy-id -i ~/.ssh/id_dsa.pub [email protected]


That should work. I'm not quite sure you are copying from the correct machine to the machine intended. You need to copy the key from the machine where you generated the key to the machine where you want to login. On that machine there must already exist a user you can login in order for the copy-command to work.

For example:

On machine1:

Code: Select all
[email protected]:$ ssh-keygen -t dsa


Copy the SSH-key from machine1 to machine2 (There logging in as user2):

Code: Select all
[email protected]:$ ssh-copy-id -i ~/.ssh/id_dsa.pub [email protected]


I hope that is somewhat clear :roll:
Je me regarde pour me désoler,
je me compare pour me consoler

Maurice de Talleyrand
Honeyman
Growing Hen
 
Posts: 159
Joined: Sun Apr 08, 2012 2:25
Location: Berlin, Germany

Re: ssh configuration ? (doesn' work)

Postby fjkhf » Sat Jan 04, 2014 10:15

Excellent!!!!!

Thank you both!

I think it needed both commands:

Code: Select all
# systemctl start sshd.service && systemctl enable sshd.service

and

Code: Select all
ssh-copy-id -i ~/.ssh/id_dsa.pub [email protected]


Thanks!
fjkhf
Simple Hen
 
Posts: 97
Joined: Tue Jun 26, 2012 13:41


Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 3 guests

cron