LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2016, 08:53 AM   #16
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,162

Rep: Reputation: 1361Reputation: 1361Reputation: 1361Reputation: 1361Reputation: 1361Reputation: 1361Reputation: 1361Reputation: 1361Reputation: 1361Reputation: 1361

Quote:
Originally Posted by kilgoretrout View Post
ssh is usually configured to deny root logins. That could be the reason for your Permission Denied errors.
Nothing to do with ssh configuration, the OP is specifying the actual user to attempt to login with, the pi@ in the ssh command.
 
Old 12-30-2016, 08:55 AM   #17
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Current: Debian and OpenSUSE. Past: Arch, RedHat (pre-RHEL). FreeBSD & OpenBSD novice, Hackintosh
Posts: 1,193
Blog Entries: 7

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by wpeckham View Post
If I may add a question:
When you run it from crontab, is it the SAME users crontab that executes it on the command line?
You never answered this question, and I believe wpeckham's on to your solution here. If you're running it from the system wide crontab, it is not going to execute as you expect.

As the user you want this script to run as,

Code:
crontab -e
then enter the appropriate information,

Code:
*/5 * * * * sudo /home/pi/Develop/bash/statusAll.sh
Any particular reason you need to run this script as root? Also, if it's in crontab, how's the sudo getting authorization? Is /etc/sudoers set up properly? Again, does this script really need to be run as root?
 
Old 12-30-2016, 08:55 AM   #18
stockton
Member
 
Registered: Jan 2006
Location: Midrand, Gauteng, South Africa
Distribution: Raspbian, Mint 13, Slackware 14, Debian & Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 1
That was what I understood was needed. The ssh-keygen was run on the same machine, namely 192.168.0.11 and I am expecting data from 192.168.0.12 & 192.168.0.13 & 192.168.0.14.
cron is running as pi ON 192.168.0.11.
 
Old 12-30-2016, 09:03 AM   #19
stockton
Member
 
Registered: Jan 2006
Location: Midrand, Gauteng, South Africa
Distribution: Raspbian, Mint 13, Slackware 14, Debian & Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 1
Using /home/pi/.ssh/id_rsa resolved the problem I was having. Thank you guys & gals.
 
Old 12-30-2016, 01:40 PM   #20
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,678

Rep: Reputation: 1654Reputation: 1654Reputation: 1654Reputation: 1654Reputation: 1654Reputation: 1654Reputation: 1654Reputation: 1654Reputation: 1654Reputation: 1654Reputation: 1654
Please mark the posts you found most informative as helpful.

Best of luck moving forward.

Happy New Year to you all!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script - command works directly in command line but not in script raoulcousins Linux - Newbie 6 08-21-2013 07:43 PM
Command works when pasted at command line but not as bash script neild Programming 7 09-23-2012 07:30 AM
(BASH) Works on the command line, hangs as a script -- what's wrong? SilversleevesX Programming 17 08-08-2010 10:19 PM
Bash script works from command line, fails from cron cmfarley19 Linux - General 4 08-14-2009 12:24 PM
works on command line but not in bash script tara Linux - General 7 02-09-2009 03:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration