LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-22-2011, 06:42 AM   #16
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983

Quote:
Originally Posted by centos123 View Post
form which user should i run the ssh-keygen?
root or fileadmin

if i run from root it ask to save in /root/.ssh/id_rsa.....
fileadmin! Every user has its own .ssh directory with its own keys (if any). If you run the rsync command as fileadmin, you have to create the keys as fileadmin and work in its own HOME directory (and leave root alone). The same for the backup server: if you connect as user fileadmin, the file authorized_keys has to be created under fileadmin's ~/.ssh directory.
 
Old 06-22-2011, 06:50 AM   #17
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 463

Rep: Reputation: 79
Do you run the rsync command while you are logged in as root or as fileadmin?
This is important because if you run it as root all the generated ssh keys (id_rsa, id_rsa.pub) have to be in /root/.ssh/ of the client from which you run rsync.
With the rsync you connect to the backup. Here you should have the id_rsa.pub in /root/.ssh/authorized_keys.

1. Find out what user you use. (if fileadmin everything that I noted before should be in /home/fileadmin/.ssh/)
2. Check wheter the client from which you connect to the backup server does have the id_rsa and id_rsa.pub in $USERHOME/.ssh/
3. On backup server check whether you have in the $USERHOME/.ssh/ the authorized_keys file which contains the id_rsa.pub.

Remember you need to run rsync while you are logged in as a user for whom you created the keys on both servers (backup,master).

Hope this helps

EDIT: Too late

Last edited by hua; 06-22-2011 at 07:56 AM.
 
1 members found this post helpful.
Old 06-22-2011, 07:02 AM   #18
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
@centos123: You are starting it in #1 as root, but in #11 you used a different user fileadmin? You would have to put the public part of the root’s ssh-key in root’s /root/.ssh/authorized_keys then, and limit the root login at least to public-key method in /etc/ssh/sshd_config:
Code:
PermitRootLogin without-password
 
1 members found this post helpful.
Old 06-22-2011, 07:04 AM   #19
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
i again generated key from fileadmin user and here is the output of\

#cat ~/.ssh/id_rsa.pub | ssh 172.16.13.1"cat >> .ssh/authorized_keys" \\\ backup ip address

The authenticity of host '172.16.13.1 (172.16.13.1)' can't be established.\\\\\backup ip address
RSA key fingerprint is d6:31:d4:76:1f:16:c9:34:1d:6b:50:0e:ed:72:6a:da.
Are you sure you want to continue connecting (yes/no)?

what should i do know yes\ no?

Last edited by centos123; 06-22-2011 at 07:06 AM.
 
Old 06-22-2011, 07:11 AM   #20
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 463

Rep: Reputation: 79
yes
 
1 members found this post helpful.
Old 06-22-2011, 07:11 AM   #21
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
thanks hua and Reuti

iam performing all command as a fileadmin not as root
 
Old 06-22-2011, 07:18 AM   #22
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
NB1: there is the command ssh-copy-id to copy the public part of a key to another machine.

NB2: hashed ~/.ssh/known_host files can be altered by ssh-keygen -R <machine> where <machine> is a hostname, FQDN and/or TCP/IP address. Sometimes you have to issue the command twice as two entries were created by the first login.

Back to the issue:

- you can login as fileadmin to the other machine without password?

- you want to perform the rsync under the fileadmin user (and limit to backup files he can see)? In which crontab did you put the command - the global one in /etc or filedamin’s private one?
 
1 members found this post helpful.
Old 06-23-2011, 12:24 AM   #23
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
gm..and thanks for helping in issue.


i deleted public and private from fileadmin user and generated key as a root...and copied id_rsa.pub in as /root/.ssh/authorized_key
in passphrase key i entered key.and when i login through ssh it ask for to enter passphrase key.i enter it and logged...
then i again generated key replacing public key and without entering passphrase key this time.Now this time iam able to login without entering root password as well as passphrase key.
now iam able to login.

Last edited by centos123; 06-23-2011 at 12:30 AM.
 
Old 06-23-2011, 12:29 AM   #24
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
when i run the rsync command


#rsync -v -e /home/fileadmin 172.16.13.1:/home/fileadmin
rsync: Failed to exec /home/fileadmin: Permission denied (13)
rsync error: error in IPC code (code 14) at pipe.c(83) [receiver=2.6.8]
rsync: writefd_unbuffered failed to write 4 bytes [receiver]: Broken pipe (32)
rsync error: error in IPC code (code 14) at io.c(1119) [receiver=2.6.8]


not able to copied but in below option i can copied



#rsync -avu /home/fileadmin 172.16.13.1:/home/fileadmin
building file list ... done
fileadmin/
fileadmin/.bash_history
fileadmin/.bash_logout
fileadmin/.bash_profile
fileadmin/.bashrc
fileadmin/.viminfo
fileadmin/c vb fg.txt
fileadmin/desktop (name v1).ini
fileadmin/dg3.mp3
fileadmin/mfjvh.odp
fileadmin/nitesh.docx
fileadmin/.mozilla/
fileadmin/.mozilla/extensions/
fileadmin/.mozilla/plugins/


sent 5777569 bytes received 314 bytes 3851922.00 bytes/sec
total size is 5775780 speedup is 1.00



why get issue between "-v -e ssh" "-avu" option?

Last edited by centos123; 06-23-2011 at 12:31 AM.
 
Old 06-23-2011, 12:49 AM   #25
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by centos123 View Post
#rsync -v -e /home/fileadmin 172.16.13.1:/home/fileadmin
rsync: Failed to exec /home/fileadmin: Permission denied (13)

why get issue between "-v -e ssh" "-avu" option?
Actually you missed the ssh word, so that it tried to use /home/fileadmin to connect.
 
Old 06-23-2011, 01:12 AM   #26
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
but using -avu /home/fileadmin it copy..

whenever i use "-e ssh " it shows error...what ever source and destination path assign.what is the reason.?

Last edited by centos123; 06-23-2011 at 01:16 AM.
 
Old 06-23-2011, 02:10 AM   #27
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
From your post above:
Code:
rsync -v -e /home/fileadmin 172.16.13.1:/home/fileadmin
Here, you did not use -e ssh but -e /home/fileadmin!

Anyway, if the public/private key are recognized by default (without specifying the key name with the -i option of ssh) you can omit the -e ssh option, since rsync uses the ssh protocol as default. It was useful only to specify the -i option.
 
Old 06-23-2011, 02:46 AM   #28
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
#rsync -v -e ssh /var/db 172.16.13.1:/home/fileadmin
skipping directory /var/db

sent 21 bytes received 20 bytes 82.00 bytes/sec
total size is 0 speedup is 0.00


it did not copy any file...total size is 0.



[root@fileserver ~]# rsync -v -e ssh /home/fileadmin 172.16.13.1:/home/fileadmin
skipping directory /home/fileadmin

sent 21 bytes received 20 bytes 82.00 bytes/sec
total size is 0 speedup is 0.00
[root@fileserver ~]#

Last edited by centos123; 06-23-2011 at 02:48 AM.
 
Old 06-23-2011, 02:56 AM   #29
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
The problem is not in the -e ssh option, but in the lack of the -r option to recurse directories. The option -a (archive mode) is a shortcut for -rlptgoD, which includes -r. Your command line should be:
Code:
rsync -av -e ssh /var/db 172.16.13.1:/home/fileadmin
You can try different options of rsync without actually copy anything (just for testing purposes) using option -n (or --dry-run) in conjunction with -v.
 
Old 06-23-2011, 03:41 AM   #30
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
rsync -av -e ssh /var/db 172.16.13.1:/home/fileadmin
building file list ... done
db/
db/Makefile
db/nscd/

sent 4730 bytes received 54 bytes 9568.00 bytes/sec
total size is 4588 speedup is 0.96


it runs...but why there is size difference in sent and total...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Backup server for SQL Server Databases --Help required snivas Linux - General 2 10-27-2010 07:11 AM
tar backup on server with 24Gb RAM - 96% cached and bdflush,kwapd feeze my server alexferro Linux - Server 4 05-23-2010 03:20 AM
Server configuration for small office server, which smtp, pop imap server and backup whitelinux Linux - Server 4 04-06-2010 11:26 AM
backup server ; network file system / ftp-server ? markus1982 Linux - Security 5 06-06-2007 05:15 PM
LXer: Backup MySQL databases, web server files to a FTP server automatically LXer Syndicated Linux News 0 08-11-2006 09:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration