We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
Hi,
I need to connect remotely to 800 server using a user which is having sudo access n do points(in order 1,2,3)
1) check status of syslog
If running go to step 2
If not restart d service
2) Make entry in /etc/sudoers of remote machine
like sudo echo "ABC" >> /etc/sudoers
3)Make an entry in local file of local machine(in which i am executing script) of what has been done in script
I managed to create a script which starts a service remotely.
for i in `cat test1`
do
{
echo "********************************************$i***************************************************"
sshpass -p '<password>' ssh -t abc@$i "sudo /etc/init.d/httpd start
}
done
Note: Servers which are to be connected are in test1 file
Pls let me know how to integrate above three in a single script
Thanks
half assed tutorials just get people in trouble
After creating keys on both ends, ssh login still was requiring password.
Message in local auth log was:
Authentication refused: bad ownership or modes for directory /home/will
Found that directories on remote host did not have correct permissions. Setting the permissions on the home directory to 700 fixed the problem.
The permissions of the .ssh directory and the authorized_keys file must be 700 and 600 respectively. These should be set properly when the ssh-copy-id command was used.