In my linux machine I'm able to do ssh to the same machine.
[myuser ~]$ssh localhost
Last login: Fri Jul 4 09:59:57 2014 from xxxx
[myuser ~]$
But when I try to run a simple remote command on the same machine using ssh, it hangs/stuck and not returning the control and no output. The command I'm trying to run is
[myuser ~]$ ssh localhost date
The same ssh works if I try from another user from the same machine
[anotheruser ~]$ ssh localhot date
anotheruser@localhost's password:
Fri Jul 4 10:00:39 UTC 2014
[anotheruser ~]$
I have seen other threads for this problem i.e. ssh hanging, But they are different. Please let me know how can I get rid of this. Is this user privileges/groups related issue or something else?
I would like to have the solution as not to modify/add some flags, so this can be resolved. The above is used in some script file and I cant really afford to change that line. Since it is working another user , there should be someway to fix it.
Please help.