Programming :: Digitally Signing Bash Scripts?

Feb 1, 2011

Is there any way to protect a bash script with a digital signature, so that it can't be executed if it has been meddled with? Or, if this is not possible for bash scripts, is it possible for any other type of scripts (Python, Perl?) in Linux?

View 5 Replies


ADVERTISEMENT

Ubuntu Security :: Using Digitally Signed Usb?

Apr 5, 2010

Has anyone setup a system to only allow digitall signed (i.e. approved USB disk drives) to be used on a Linux System.

View 1 Replies View Related

Software :: How To Digitally Sign Doc Created With Word Processor

Apr 20, 2011

I am looking for an easy way to digitally sign documents produced with regular word processors. Here are my findings so far:LibreOffice and OpenOffice are ready to digitally sign documents. There are a few steps involved (such as obtaining the certificate). For documents produced with a different word processor (such as Abiword), there is always the option to transform them into pdf documents, which seem to be ready to be digitally signed, with specific software. The first thing I looked at was gpg, which allows for a detached signature and also for a "clearsign" option, which attaches the signature to the document.

I have already ruled out the "detached signature", as this imposes another degree of difficulty to handle a stack of documents that will need to be classified and relocated frequently. As for the "clearsign" option, it is great for simple text documents but, when used with Abiword documents (for instance), the few extra lines outside the xml tree renders them impossible to read. So far, forcing all my coworkers to use only LibreOffice seems to be the simplest alternative.

View 2 Replies View Related

Programming :: Bash: Printing The Line Number In Bash Script?

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

Programming :: Bash Ctrl+c Tarp And Bash Read With Timeout?

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

Programming :: Reading A Bash Variable In Bash Scripting ?

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

Programming :: Run Multiple Bash And Php Scripts From A Bash Script?

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

Programming :: Bash: Get Filename And Extension Using Bash?

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

Fedora :: How To Boot Up Without Signing In

Jul 2, 2010

I have had to ditch ubuntu after 4 happy years as their 10.04 release was crazily resource hungry on my humble machine. Installed F13 smoothly and without any problems and so far it doesn't appear to be as resource hungry as ubuntu. One thing I have not been able to find in either gnome preferences or administration is where to set it to go straight to desktop without messing around with passwords and stuff.

View 3 Replies View Related

Fedora :: Pidgin And Empathy Not Signing Into Msn?

Jan 18, 2010

Recently jumped from Ubuntu to Fedora 12 over the weekend, has been quite the bumpy ride. Though fun of course. But I'm having trouble coming to a solution for this problem, that started today. When signing into both Empathy or Pidgin (only with msn account) they both just hang on the white screen inactive... I say "inactive" the program hasn't frozen I just cannot be signed in. Also, in Pidgin at the bottom, next to where it shows your status, it has;

"Available - Waiting for network connection"

View 3 Replies View Related

Server :: Signing Up To The Amazon EC2 Service With EBS?

Jan 9, 2011

I am interested in signing up to the Amazon EC2 service with EBS. I have never used a unmanaged vps before, but I know how to use the command line etc. There are some basic packs on there to use, with basic LAMP stacks. But I would like to ask about how do I:

Upgrade a lamp stack? - someone mentioned yum, but what is this? how easy is it to use? is it enough? secure the lamp stack? - assuming I have no idea of linux security, can you give me a list or something of things I need to consider so I can begin the search (or just cover the steps would be awesome!) My website just uses php and mysql, so thats all i'll need. If you have any other tips on this,

View 1 Replies View Related

Debian :: Creating Certificate Signing Request - CSR?

Jun 9, 2015

I need to renew my SSL cert for my Mahara site and I follow the instructions below. But after I finish answering all the questions for the csr, I'm supposed to copy a portion of the cert into a web form. However I can't seem to find the server.csr so I can do this. Were this file goes?

Here is a step-by-step description:

Make sure OpenSSL is installed and in your PATH.

Create a RSA private key for your Apache server (will be Triple-DES encrypted and PEM formatted):

$ openssl genrsa -des3 -out server.key 1024

Please backup this server.key file and the pass-phrase you entered in a secure location. You can see the details of this RSA private key by using the command:

$ openssl rsa -noout -text -in server.key

If necessary, you can also create a decrypted PEM version (not recommended) of this RSA private key with:

$ openssl rsa -in server.key -out server.key.unsecure

Create a Certificate Signing Request (CSR) with the server RSA private key (output will be PEM formatted):

$ openssl req -new -key server.key -out server.csr

Make sure you enter the FQDN ("Fully Qualified Domain Name") of the server when OpenSSL prompts you for the "CommonName", i.e. when you generate a CSR for a website which will be later accessed via https://www.foo.dom/, enter "www.foo.dom" here. You can see the details of this CSR by using:

$ openssl req -noout -text -in server.csr

View 2 Replies View Related

Fedora :: Flash Plugin Signing Key - Cannot Update

Aug 11, 2010

Running graphical software update, fc13. Attached are screenshots, which appear in sequence. The first seems to be asking if I trust the source, Adobe. (The Help for this window says I can go to the adobe website to confirm details of the signing key, which I will do if there is not a simpler fix.) If I respond in affirmative to the first window I get the failure window, second shot, with traceback.

View 5 Replies View Related

Ubuntu :: Archive Automatic Signing Keys 10.10?

May 14, 2011

Initially I had a problem installing restricted extras. However, it appears the problem is more than a media problem, so I moved my thread here. I copied over what I thought the relevant code was from my previous thread. Anyone have ideas on how I can fix this?

Code:
onoku@onoku-MacBook:~$ sudo apt-get update && sudo apt-get upgrade
[sudo] password for onoku:

[code]....

View 9 Replies View Related

Ubuntu :: Pidgin Not Signing In After Changed Hotmail IM Password?

Feb 23, 2010

So Pidgin was workign just fine in Ubuntu Studio karmic... After i Changed my password for my msn IM for security reasons it just woun't sign me in.

Iv tried so many times, my pass is correct... But i keep getting this message

"NEW MSN account
Authentication failed
Edit Account"

View 2 Replies View Related

General :: Yahoo Messenger Not Signing In With Squid 2.5 Stable 6

Aug 30, 2009

I have configured squid 2.5 stable 6. I can browse any website. I can even use msn messenger but I cannot use yahoo messenger. I have also set the http proxy settings in preference for yahoo messenger but still it does not sign in.

View 6 Replies View Related

Ubuntu :: Which Jabber/XMPP Client Supports Both Signing And Encrypting Messages With Openpgp

Jun 16, 2010

I've been trying to find out which jabber/XMPP clients out there automatically sign messages with openpgp you send but documentation on that has been spotty. Could you tell me a. if you know any clients that can easily sign and encrypt all outgoing messages and b. should I worry if a client is only able to sign presence and not messages?

View 1 Replies View Related

Programming :: Bash Programming - Rename Files In A Loop?

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

Programming :: Write A Bash Script That Sources Another Bash Script?

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

Programming :: Bash Scripting To Programming?

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

Debian Installation :: "Signing Keys" / Verify The File With MD-5, SHA-256?

Mar 31, 2011

Anyone attempting to install Debian Squeeze from CD-1, or Debian-live DVD will want to know how to verify the file with MD-5, SHA-256 and (available for some versions only) SHA-512 checksums of the iso images, using the appropriate signing key. But there are no instructions that I can find in the Debian CD FAQ, which simply points users at the archive keyring. Now according to this message, as of 9 Feb 2011 the Debian Squeeze archive signing key has fingerprint 9FED 2BCB DCD2 9CDF 7626  78CB AED4 B06F 4730 41FA

The Debian signing key website gives the archive signing key as the master key, and (this addresses the problem I raised elsewhere) even makes it available via https. That sounds good! Just one problem: the detached signatures for files such as url

which gives the SHA-256 sum for url

have been signed with a different key, which has fingerprint DF9B 9C49 EAA9 2984 3258  9D76 DA87 E80D 6294 BE9B

No wonder I am confused! And it seems that I may not be the only one; others seem to be confused also.

If no-one at the Debian mailing list can explain what is going on, I have little hope that anyone here will be able to clear this up, but I'll ask anyway: what are all the Debian related GPG keys and where do you find them all? is it true that there are different keys needed to verify CD iso images and debs? (And... what else?) where do you go to obtain all the lastest Debian keys via https? (This is important as it can hinder MITM attacks by lone crackers, assorted crooks, maybe even state actors, etc.; the "Comodogate" story provides clear evidence that there are people or organizations interested in mounting MITM attacks on persons downloading open-source software). in particular, it is sometimes convenient to use a live-CD to download an iso image (for example, when you no longer trust the system you are trying to upgrade!) and then one wants to use GPG to check the file with the checksum, so one needs to quickly locate and import into the GPG keyring of the (temporary) live-CD session the correct key; so where can I find the CD-signing key availalble via https? shouldn't the CD FAQ explain all this?

View 5 Replies View Related

Programming :: Sed A Variable In Bash?

Mar 25, 2011

I have beat this enough and don't get what should have been a very simple thing to do. I build a variable;

Code:
CLIST=java,lua,python,php,perl,ruby,tcl
CLIST will be used by another bash script but I need to replace the commas with a space. I

[code]...

View 2 Replies View Related

Programming :: Bash Script HELP - Hex To Dec ?

Dec 4, 2010

Creating script that converts hex to dec. But without using bc calculator or other methods that could convert it in one line. I need to make something like this script that converts dec to hex.

View 1 Replies View Related

Programming :: Can Use Bash Within An Awk Script

Apr 14, 2011

I have a basic awk script that can read a file named 'server_info' and output to the screen which fax lines are not working. Now I want to make the script execute commands instead of printing to the screen but I am having trouble... This is better explained by my code below:

test.sh Code: #!/usr/bin/awk -f
#
#The name of this script is test.sh

[code]....

View 1 Replies View Related

Programming :: Bash Command From PHP?

Jul 14, 2011

Distro: Centos 5, PHP 5I have done a bit research on running bash commands from php and there was little success. This is my relevant php script

<?php
echo exec('pwd');
?>

[code]...

View 16 Replies View Related

Programming :: Bash Function Using If / Then And Else

May 2, 2011

I am trying to build a function inside a script.

Code:
#!/bin/sh
#System commands and other configurable.
IPT=/sbin/iptables
IP6T=/sbin/ip6tables
IPST=/usr/sbin/ipset
MODP=/sbin/modprobe
GET=/usr/bin/wget
INT_NET=192.168.1.0/24 .....

I can find lots of tutorials in how to use if, then, else. However, how do I define a variable inside the function?
SEE>>
Code:
for c in $ISO
Also, am I using the 'test' command correctly( -/+ week as valid test)?

View 7 Replies View Related

Programming :: Bash IF Using IP Subnets?

Feb 14, 2011

I'm somewhere between Novice and I have no idea what I'm doing with bash scripts. I'm writing a script to deploy images using partimage on my company's desktops, and while I have just about everything else figured out I have one issue left.Each of our 4 sites that will be using this disc will have a deployment server due to the fact that our sites have dedicated point to point links that our business traffic is conducted on. I need to be able to determine what site I'm at based onubnet and set a variable based on this determination. What I don't know is how to get the IP address in to an if statement, and properly determine subnet. For example:

192.168.1.0/16 - 192.168.7.0/16 need to use DEPLSERV01
192.168.8.0/16 - 192.168.16.0/16 use DEPLSERV02
192.168.17.0/16 - 192.168.24.0/16 use DEPLSERV03

View 1 Replies View Related

Programming :: Difference Between /bin/bash And /bin/sh?

Dec 27, 2008

I know it's a very silly question but could someone please explain the difference between "/bin/bash" & "/bin/sh" I was under the impression that both are same but following output on my Ubuntu 8.10 is making me raise my eyebrows.

Quote:

parag@station3:~$ ls -l /bin/bash ; ls -l /bin/sh
-rwxr-xr-x 1 root root 725136 2008-05-13 00:18 /bin/bash
lrwxrwxrwx 1 root root 4 2008-12-03 21:42 /bin/sh -> dash
parag@station3:~$

View 11 Replies View Related

Programming :: Run Bash Script On Web?

Apr 9, 2010

i want to run bash script on website.i still have to choose between unix hosting and windows hosting. my web hosting service offer Own Cgi - Bin PHP,ASP,MYSQL,MSSQL, and script schedule(cronejob). This is script

#!/bin/bash
#Store arguments from bash command line
fight=$1
support=$2
msg=rmsg

[Code]....

View 2 Replies View Related

Programming :: Using Eval In Bash?

Nov 23, 2010

Having a problem with an unwanted redirection in in a function call. Although this isn't the function it does illustrate the problem:

Code:
#!/bin/bash
doat () {
ALL="sys1 sys2"
for Sys in $ALL;do
echo "---> $Sys <---";
echo $(eval echo $1);

[Code]...

figure out how to get the variable into the command without outputting to the file in the eval statement? So that ssh line that gets executed would look like the following to each iteration of the for loop:

Code:
ssh root@$Sys rpm -qa|sort > /trans/${Sys}-rpm-list.txt;
doat works when the incoming argument doesn't have any redirection in the command.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved