I get this error: Too many arguments. If I run my ssh-keygen command

I am programming a litte “chatroom” for linux users. The system is very easy. The user opens an ssh-connection and then starts a “reader.sh” script which is just an tail -f command running and he openes in another ssh-connection a “writer.sh” script which just writes in the same file. (echo “hi” >> example)

The problem is that if the user starts my script, hes asked 2 times for the password. I want to disable that and wrote this script:


ssh-keygen -t -f/home/$USERN/.ssh/id_rsa -P$PASSWD rsa
ssh $USER@$IP mkdir -p .ssh
cat .ssh/id_rsa.pub | ssh $USER@$IP 'cat >> .ssh/authorized_keys'
gnome-terminal -e "ssh $USER@$IP writer"
gnome-terminal -e "ssh $USER@$IP reader"


(the important part:)

ssh-keygen -t -f/home/$USERN/.ssh/id_rsa -P$PASSWD rsa

But if I run this “install.sh” script I get this error:

Too many arguments.

What did I do wrong? Can somebody help me?

Source: shell

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.