Thursday, June 27, 2013

ssh Error : scp: ambiguous target

scp: ambiguous target

If you are transferring files from your host to another host and there are spaces in the path, you could get this error.

If there are spaces in the directory name of source (your system) and you have used double quotes in the path, you will not get the error but if there are spaces in the directory name of destination (remote host) and you have used double quotes in the path, you could still get the error.

To remove this error
Use backslash before spaces.

Suppose there is a directory "linux host" in the root of Remote Host and you want to transfer a file test.txt from your root directory to the remote host directory  "linux host". You should use this command.
# scp "/root/test.txt" 192.168.xx.xx:"/root/linux\ host"
Since there is space in the directory name "linux host" that's why I have used backslash before space.
Now you will not get the error while file transfer.

If you put just double quotes in the remote host path and you do not put backslash before space, you will get the error scp: ambiguous target

One more example :
# scp "/root/Documents/file.txt" 192.168.xx.xx:"/root/untitled\ folder/red\ hat/linux\ host"
where
192.168.xx.xx is IP of Remote Host

Remove start up applications using command line

Remove/Delete Start up applications using command line :

When you want to run a command or a script automatically just after log-in, you create a start up application using Startup applications preferences. If you want to remove them, you use remove button, placed at bottom of the add button, to remove them.



But suppose you have created a application and because of some bad code, it is not able to let you reach on the desktop. You log-in and and your system is turned off automatically or you face any other similar problem.

Now you want to delete the command or the script from start up applications. But How?
You are not able to reach on Desktop.

Here is good news.
You can delete the application from command line.

You can reach on command line using recovery mode or you can press key combination ctrl+alt+f1 when log-in screen is appeared and it takes you on command line.

All startup applications are stored in the directory /root/.config/autostart.
If you are logged in as a user, you can find your all start up applications in /home/username/.config/autostart

Just reach to the directory using
# cd /root/.config/autostart or # cd /home/username/.config/autostart
list the applications using ls command and delete your corrupt application.

The file extension of the application is .desktop

Alternatively if you know the application name, you can delete it using
# rm /root/.config/autostart/application-name.desktop
or
# rm /home/username/.config/autostart/application-name.desktop

ssh Error : /usr/bin/ssh-copy-id: ERROR: No identities found

Error : /usr/bin/ssh-copy-id: ERROR: No identities found :

Solution :

Run following command on the client
# ssh-add

If it gives following error.
 Could not open a connection to your authentication agent
To remove this error, Run following command.
# eval `ssh-agent`
Now try to run ssh-add again.

If you are still getting this error, check if you have generated the keys using ssh-keygen.
Read here.