Linux - ServerThis 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.
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.
Hey, the best bet for this is to set up a public/private key set for the deal. If you keep the private key on the originator and the public key on the target machine you can do the copy without a password (the keys will validate the login).
I would highly recommend the OReilly Linux Server Hacks book for the details. The section on SSH is well worth the time if you are moving files (or yourself) around between servers. In just a few pages it can totally change the way you run around inside you own machines.
Edit the sshd_config file so that the server uses public key authentication rather than password authentication. Then add your public key to the authorized_keys file on the server. This is explained in the sshd_config man page and the comments of the sshd_config file. Consider adding a "from=" option to your entry in the authorized_keys file. The info for this is in the sshd man page.
If possible, try to log as a different user. For example, create a regular user for backup purposes (lets say buser) and save the backups in that users home directory instead of in /root.
The cron job can still be run as root on the local machine. Simply use a command like "scp -p buser@ip_address:/u/backups/bkup1* ./" instead.
The root account is a known entity. If you can disable root ssh logins you will be much safer.
Also, saving the files to /home/buser or another directory where buser has write access instead of /root. Remember that the ext3 and other filesystems reserve a percentage of drive space on the filesystem for the root user. That way if the drive is full (to normal users), the root user still has some wiggle room to work and remedy the problem. The /root directory is usually on the root (/) partition. If that fills up it could cause more problems than if the /home or /var/ partition filled up (asuming they are on their own partitions).
If you use putty, there is a keygen.exe program that you can use to load in your private key (*.ppk). Load in your key and near the top of the window, the public key is displayed. You can highlight and copy this key, which is compatible with openssh's authorized_keys file. The putty keygen program even points this out.
If you use putty, there is a keygen.exe program that you can use to load in your private key (*.ppk). Load in your key and near the top of the window, the public key is displayed. You can highlight and copy this key, which is compatible with openssh's authorized_keys file. The putty keygen program even points this out.
Where do I get this keygen.exe? I tried to Google it, but I see a lot of hits that say it is a trojan.
you are looking for the wrong command. You should be looking for ssh-keygen to create a private/public key. You can easily create the key as follow:
1. ssh-keygen -t rsa
a. (select default unless you want to use passphase)
b. this will create 2 files in /home/userid/.ssh directory (id_rsa & id_rsa.pub)
c. cd /home/userid/.ssh
2. scp id_rsa.pub userid@server:.ssh/authorized_keys
3. repeat step 1 and 2 to all other servers
This will let you ssh and scp between server without password.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.