I am having a problem using Rsync/SSH with a specific user for Amanda backups on a server.

rsync -e 'ssh -i /var/lib/amanda/.ssh/id_rsa_amdump' -az otherserver:/dir/to/copy /copy/dir

I have noticed that it gives all kinds of errors on a script within /etc/profile.d and cannot log on with the SSH key. If I try to log into the user account with SSH it just displays errors and will not give a prompt. Is there a way to tell the user to not read /etc/profile.d or to set it to skip/exclude that user?

The errors it gives on log on attempt with SSH is:

/etc/profile.d/somescript.sh line 125: bind: warning: line editing not enabled

It shows this error for at least 20 different lines inside the script. I do not get this error for any other user. In addition the home directory for the Amanda backup user is in /var/lib/ not /home.

  • 1
    I imagine the best solution may be to simply fix the error in the scripts. It's surprising that the specific user can't log on but others can. Do they have a different shell configured? – etherfish Feb 20 '14 at 21:09
  • What are the error messages ? – Iain Feb 20 '14 at 21:28
  • What's line 125 of somescript.sh ? – Iain Feb 20 '14 at 21:30
  • bind -x '"\e[M":'$'"ls -l"'; – 에이바 Feb 20 '14 at 21:35

Using bind only makes sense in a interactive shell. In somescript.sh check if the shell is interactive and only run bind if it is. For example,

if [ -n "$PS1" ]; then
    bind -x '"\e[M":'$'"ls -l"';
  • An alternate test is if tty -s; then .... – BillThor Feb 20 '14 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.