Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
06-22-2011, 06:42 AM
|
#16
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Quote:
Originally Posted by centos123
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.
|
|
|
06-22-2011, 06:50 AM
|
#17
|
Member
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 463
Rep:
|
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.
|
06-22-2011, 07:02 AM
|
#18
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339
|
@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.
|
06-22-2011, 07:04 AM
|
#19
|
Member
Registered: Apr 2011
Posts: 397
Original Poster
Rep:
|
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.
|
|
|
06-22-2011, 07:11 AM
|
#20
|
Member
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 463
Rep:
|
yes
|
|
1 members found this post helpful.
|
06-22-2011, 07:11 AM
|
#21
|
Member
Registered: Apr 2011
Posts: 397
Original Poster
Rep:
|
thanks hua and Reuti
iam performing all command as a fileadmin not as root
|
|
|
06-22-2011, 07:18 AM
|
#22
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339
|
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.
|
06-23-2011, 12:24 AM
|
#23
|
Member
Registered: Apr 2011
Posts: 397
Original Poster
Rep:
|
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.
|
|
|
06-23-2011, 12:29 AM
|
#24
|
Member
Registered: Apr 2011
Posts: 397
Original Poster
Rep:
|
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.
|
|
|
06-23-2011, 12:49 AM
|
#25
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Quote:
Originally Posted by centos123
#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.
|
|
|
06-23-2011, 01:12 AM
|
#26
|
Member
Registered: Apr 2011
Posts: 397
Original Poster
Rep:
|
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.
|
|
|
06-23-2011, 02:10 AM
|
#27
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
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.
|
|
|
06-23-2011, 02:46 AM
|
#28
|
Member
Registered: Apr 2011
Posts: 397
Original Poster
Rep:
|
#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.
|
|
|
06-23-2011, 02:56 AM
|
#29
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
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.
|
|
|
06-23-2011, 03:41 AM
|
#30
|
Member
Registered: Apr 2011
Posts: 397
Original Poster
Rep:
|
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...
|
|
|
All times are GMT -5. The time now is 06:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|