Programming :: [Bash] Denied Script * Opinion's Welcome *?
Jan 30, 2011
wrote a simple script that will Parse Secure log find the failed login attempts, and strip out the IP Address. Then take those address and create a file listing them. Thx to colucix for the awk understanding which is then fed into Nmap grabbing OS and Ports that are open on that remote machine -> output is shoved threw Sed only grabbing the Characteristics I felt were need. The output from that is piped into another Directory called Nmap/ and files are created with the output and ipaddress for the file name;
Then that same list that was fed into Nmap is fed into Whois and output is shoved into SED striping out the non-sense getting only valuable info. Those are then put into the Whois/ with the file names being the IP Address and whois info dumped into them.There are lots of paths I can go to continue the chain with all this info... But for now it just merges the Whois Info and Nmap Info into a Master File which is then fed to ssmtp to send an email with the Info to whatever address you like.Put it in a cron job, and it executes every night at 11pm with the secure log being rotated out at 1105pm. Cycle is then repeated. Like I said this is really my first Bash Script.
I have done Batch script with, remote printer mappings, and default printer setups. But thats here nor thereWhat I am really looking for since this script is functional, is your criticism and your technique on another way of accomplishing the objective your critiquing. Just trying to build my skills and look at this process from another perspective.
Code:
echo 'Grabbing the IPs'
# Grabbing IP's from secure log, putting them in the ip array, and then spiting out the
[code]....
View 10 Replies
ADVERTISEMENT
Jul 20, 2011
I am writing a bash script to run everyday and output results to a file. When the same results are produced i want to overwrite the line from the previous day. (Or remove and add). So if the script finds a variable in a line. i want it to output the results to that line . sed -i did not work for me; sed: couldn't open temporary file ./sedTvOCEg: Permission denied
View 10 Replies
View Related
Mar 27, 2010
I tried to execute the following command: $ ./eval_online_wiki.ml -db_user aa -db_pass bb -db_name cc It returned as follows: bash: ./eval_online_wiki.ml: Permission denied What does this mean? How to solve the problem? Actually, I was following a README, and it says "$ ./eval_online_wiki -db_user <username> -db_pass <pwd> -db_name <db_name>"
View 2 Replies
View Related
Jan 2, 2009
I'm trying to run a backup using CPIO to an LTO2 tape in an HP Ultrium 460 drive using the following:find / -path /proc -prune -o -print | cpio -o -H crc --block-size=128 > /dev/st0Each time I get the error:-bash: /dev/st0: Permission deniedThis is regardless of whether I sudo the two sides of the command or not. I have used dd if=/dev/st0 of=/tmp/test.file ibs=128k count=1 to verify the blocksize (and since I was a little confused about block-size in cpio I also tried --block-size=256)
View 5 Replies
View Related
Nov 3, 2010
What is your opinion on *very* early development builds of Ubuntu? I decided to post this poll because I have *already* upgraded to the Ubuntu 11.04 "Natty Narwhal" Pre-Alpha.
Please explain your votes in detail. Edit: Sorry for not posting the poll; accidentally posted too fast.
View 2 Replies
View Related
Sep 24, 2010
trouble when I log in the fedora as a normal user(not root) today. When I fill the username and the password press enter key. Then pop up a little window locate at topleft corner. And have one line message : "/usr/bin/xterm : Could not exec /bin/bash : Permission Denied"hen I log in as root, it's ok. And when I open shell and type "su username" then the console print "su: /bin/bash: Permission denied"I have checked the perms of "/bin/bash" , it's 755. And I have tried all things which suggested from articles searched through Google. like change / or /root and other directory's permissions but failed
View 4 Replies
View Related
Jan 18, 2010
dave@dave:/var/spool/cron$ sudo dir crontabs
[sudo] password for dave:
dave root
dave@dave:/var/spool/cron$ ls -l
total 12
drwxrwx--T 2 daemon daemon 4096 2009-10-28 16:02 atjobs
drwxrwx--T 2 daemon daemon 4096 2009-09-15 08:09 atspool
drwx-wx--T 2 root crontab 4096 2010-01-18 10:39 crontabs
dave@dave:/var/spool/cron$ cd crontabs
bash: cd: crontabs: Permission denied
dave@dave:/var/spool/cron$ sudo cd crontabs
sudo: cd: command not found
Is this caused by something I have set wrong? I can successfully do:
Code:
sudo cat crontab/dave
View 4 Replies
View Related
Sep 10, 2010
If I run this as su I get the same thing. If I log on as root user It is the same as well
View 5 Replies
View Related
Aug 24, 2010
[root@mail tmp]# ./PE1650_RAID_FRMW_LX_R168387.BIN-bash: ./PE1650_RAID_FRMW_LX_R168387.BIN: Permission deniedalso get it when trying to run[root@mail tmp]# ./ESM_FRMW_LX_A37_R117418.BIN-bash: ./ESM_FRMW_LX_A37_R117418.BIN: Permission denied
View 2 Replies
View Related
Sep 17, 2010
I use xp and ubuntu 9.10 both in dual boot mode on my system and wish to install a new red hat based linux on my computer, so which is the best redhat based system to start off with : fedora or mandriva ? also, How many operating systems can i install on my system ?
View 4 Replies
View Related
Aug 10, 2010
I've been using Digikam and it's a huge blow to my system memory. Even after quitting I still feel my computer to be slightly slower. I tried running the commands from [URL] but I get this instead
bash: /proc/sys/vm/drop_caches: Permission denied
View 4 Replies
View Related
Dec 16, 2009
Firstly, i'm NEW to Linux and my very first time with DSL. I'm installing this on an older Dell Latitude laptop.
I just finally got the DSL installed on my HDD successfully and then I added feh to start and run at start up, then I rebooted and now i'm getting this error:
No, directory, logging in with HOME=/ -bash: cd: /home/dsl: Permission denied
I have tried reading numerous websites but none explains to the level whereby I can understand. I even tried rebooting from the CD, but could not figure out how/what to do next?
The question is, can someone explain how I can use the DSL CD to try to correct this error. More importantly, can you explain in layman terms so that I can actually put it good use.
Also, some additional questions I have....when you download a file where does it save to?
View 6 Replies
View Related
Sep 24, 2010
I'm in trouble when I log in the fedora as a normal user(not root) today. When I fill the username and the password press enter key. Then pop up a little window locate at top left corner. And have one line message : "/usr/bin/xterm : Could not exec /bin/bash : Permission Denied" Then I log in as root, it's ok. And when I open shell and type "su username" then the console print "su: /bin/bash: Permission denied" I have checked the perms of "/bin/bash" , it's 755. And I have tried all things which suggested from articles searched through Google. like change / or /root and other directory's permissions but failed.
Code:
[root@localhost lib]# ldd /bin/bash
linux-gate.so.1 => (0x00687000)
libtinfo.so.5 => /lib/libtinfo.so.5 (0x05846000)
[code]....
View 2 Replies
View Related
Sep 9, 2011
I have tried changing permissions and I have looked for a solution, but the error still exists.In fact it gives me a different error every time I log in.
Could not chdir to home directory /home/rb27: Permission denied
here is a snippet of what I get when I use the command ls -al:
drwxr-xr-x 16 root root 0 Sep 8 18:28 .
drwxr-xr-x 23 root root 4096 Feb 5 2011 ..
d????????? ? ? ? ? ? ajd74
d????????? ? ? ? ? ? ban45
d????????? ? ? ? ? ? rb27
I cannot log in as root since the permission is denied
View 1 Replies
View Related
Feb 26, 2011
Changes : Aug 19, 2011Slackware 13.37Slackbuild : 43c5e2fe7a92bdcbf375da02d1da565b echinus.tar.gz
<Old thread information>
<Edit> Noticed OPTS isn't used, so am working on learning how to use diff, and checking a few other things out with the script.
<Edit 2>
View 5 Replies
View Related
Nov 5, 2009
I have tried to mount Sda on my laptop HP dv6 and I have got this problem [root@cpe-74-71-125-175 ~]# /dev/sda1 /mymount/win ntfs-3g rw,umask=0000,defaults 0 0 bash: /dev/sda1: Permission denied
View 3 Replies
View Related
Feb 4, 2011
I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.
View 3 Replies
View Related
Jan 24, 2010
simple bash code:
Code:
#!/bin/bash
trap "echo 'you got me'" SIGINT SIGTERM # to trap ctrl+c
echo "Press ctrl+c during 5 sec loop"
for ((i=0;i<5;i++)); do
[Code]...
How come code behaves normally and stops when ctrl+c signal is caught and resumes, but after I use at least one timeout read in the code it looks like, if signal is caught again it doesn't pause the execution but skips the loop. If you remove -t (timeout) option from the read, both loops look the same!
View 10 Replies
View Related
Nov 26, 2008
I have a config file that contains:
my.config:
Code:
Now in my bash script, I want to get the output /home/user instead of $HOME once read. So far, I have managed to get the $HOME variable but I can't get it to echo the variable. All I get is the output $HOME.
Here is my parse_cmd script:
Code:
View 3 Replies
View Related
Jul 25, 2011
I have written quite a few separate bash & scripts and php scripts that up to now I have run from cron jobs. However I have to estimate how long each takes to run, before running the next and so it probably takes much longer than necessary to run them all. They have to run in order.
Now there are so many I am thinking it would be better to have a master bash script that would run one after the other, but I am not sure how to get the master script to wait before starting to run the next script. Is this possible and is there a command that will make the script wait between bash and php scripts , for them to finish, before running the next?
View 5 Replies
View Related
Jan 9, 2010
I would like to get the filename (without extension) and the extension separately. The best solution I found so far is:
Let FILE="thefilenameofsomefilesfor_instance.txt"
Code:
NAME=`echo "$FILE" | cut -d'.' -f1`
EXTENSION=`echo "$FILE" | cut -d'.' -f2`
I think it would be better to count the len and remove 3 chars to right to get the extension, but it can be macintosh filenames with have 4 chars for extensions.
View 5 Replies
View Related
Jun 8, 2010
I have three partitions. One for each: Windows, Debian and my files. I wanted a partition available in all systems, so I created FAT32 and mounted it as /data and drive D. In linux I created symlinks in my /home folder to /data/documents/xxx/xxx. I wanted to save my projects on that partition, but in every IDE I tried I get the permission denied error.
Screenshot
What should I do to make /data writable for IDEs? As normal user I have full access to it.
View 9 Replies
View Related
May 29, 2011
i'm trying to run some code i had written a couple of weeks ago in windows :$, the program has to create and copy some files and when i try to run this code in monodevelop this error:Unhandled Exception: System.UnauthorizedAccessException:Access to the path '/tmp' is denied.i've tried to change the path where i know i have read/write permissions but it doesn't seem to work, the code was originally written to create a file in the Temp folder in windows.
View 1 Replies
View Related
Feb 23, 2010
My /usr/lib/cgi-bin/script.cgi must create a directory in my /home/myname directory, but in firefox appears:Quote:Software error:Cannot mkdir: Permission denied at /usr/lib/cgi-bin/script.cgi line 17.For help, please send mail to the webmaster (webmaster@localhost), giving this error message and the time and date of the error
View 3 Replies
View Related
Mar 9, 2011
I've just recently started learning shell scripting and I've been working on a basic csh script, but I've been having a few problems. Here's the script
Code:
#!/bin/csh
echo Enter a file name
$< = FILE ##Name of file
echo enter a size (in kilobytes) to monitor
SIZETOMON = $< ##Size value that's input by user
du -k $FILE = $SIZE ##Size of the file that the user wishes to monitor
while (1)
if $SIZE > $SIZETOMON then
echo ALERT: File size is greater than $SIZETOMON
end
And here's the output
Code:
/home/lucer/foo.txt: Permission denied.
Badly placed ()'s.
I'm not really sure what the issue is with the "badly placed ()'s" or why it won't let me access files that I can access with the same shell when it's not in a script.
View 14 Replies
View Related
Mar 18, 2009
I have a written a java code to ftp a file from the windows box to unix box. It keeps giving me the following error : "java.io.FileNotFoundException: PORT 204,63,56,5,16,78: 550 Permission denied." I am able to ftp manually from windows to unix.
View 5 Replies
View Related
Mar 31, 2011
I need to rename the resulted searched files from a loopI have the following code:
find . -name DOC* | while read i
do
find $i -type f -name '*.txt'
done
basically, I am searching for all txt files inside any folder starting with DOC name.this code is working fine with me.I need to rename those .txt files to .txtOLDOS: Ubuntu 10.4Bash shell
View 10 Replies
View Related
May 3, 2011
In user mode [non-root] linux machine, tried to bind a socket by using a"ioctl(iInterfaceSocket, SIOCSIFADDR, &stCommand)". I am getting error 13 -> Permission denied because of user mode. If change from usermode to kernel mode everything works fine.I need to bind the socket in user mode only, please suggest solution for the abovewhile explaining the above,
View 2 Replies
View Related
Jan 29, 2011
I am trying to write a bash script that sources another bash script. Essentially, I need a few lines to check to see if a certain variable is set. If not, I set it manually, and then source a scripts with that variable in the path. I wrote a test script to try it, but for some reason the last line does not work. Here is what I wrote:
#!/bin/sh
source ~setupdir/setup.shrc #just a test, this line works
echo ${#SETUP} # prints 0 if setup is not set, which it isn't
if [ ${#SETUP} -eq 0 ]
then
SETUP="~setupdir"
fi
echo $SETUP # prints ~setupdir
[Code]...
View 5 Replies
View Related
Jul 13, 2011
i'm in the process of learing C++. currently i'm creating shell scripts to get things done. i'm just curious how, as a programmer using C++ you would get a similar job done.as an example i have a script that takes the contents of files, pipes it to some sed and awk commands, which is piped to create a new file. that file is then imported into a mysql database.if you were going to do this in C++, would you call the sed/awk programs to modify the file, or can it be done within the program itself? i'm probably jumping the gun here because i've just started learing about pointers so this is above my ability
View 12 Replies
View Related