Thursday, June 27, 2013

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.

Show GUI alert boxes on remote host

Show popup/alert box on other system :

Sometime you want to give just a message to your colleague, you do not want reply. 

If you do not want to send messages on terminal or chat-box, you can use alert box to display the message but you should be able to log into your colleague's system.



Requirements:
ssh should be installed on both systems.
You should be able to log into your colleague's system.

Steps:
Log into the Remote Host (your colleague's system) using ssh.
# ssh 192.168.xx.xx
where 192.168.xx.xx is IP of the Remote Host.
Run following command on his/her command line
# DISPLAY=:0 zenity --info --text="your-message-should-be-here"
If you want to give the title for the message box.
# DISPLAY=:0 zenity --title="your-title" --info --text="your-message-should-be-here"
If you would not use DISPLAY=:0 in your command, it would show a display error.
Gtk-WARNING **: cannot open display: 
If you open the display using -X in your ssh command like ssh -X 192.168.xx.xx and run the command without using  DISPLAY=:0, it opens the alert box but on your system. Your colleague would not be able to see this.
You have to set DISPLAY on remote host.


Wednesday, June 26, 2013

Track the users who are using sudo

List of users who are using sudo :

If you are root of the server and there are several users who are logged in to the server, you should know your user activities.

There can be some circumstances that you just can't disable sudo facility and the reason is not that you don't know how but you can't because you have to give the functionality to the users.

You must know that how to find number of users, current logged in users and all that stuff.

But some of your user can misuse the sudo facility. You should track the record that  who are currently using sudo.

Fortunately Linux can track the record for you. To read this log file, you can know the list of the users who are using sudo.

If you are using Debian or ubuntu, the location of the file is
/var/log/auth.log

If you are using CentOS, Fedora or RHEL, the location of the file is
/var/log/secure

If user tries to remove his/her entry from the file, it enters this act in the file too so you can know that user has edited the log file and he has done something nasty.