Re: [CentOS] echo password into bash script

2015-08-25 Thread Marc Wiatrowski
What are you trying to do?  Copy your public key out to use it for future
authentication?  Use ssh-copy-id to set it up the first time?  Or look at
the package sshpass.

On Tue, Aug 25, 2015 at 12:58 PM, zep  wrote:

>
>
> On 08/25/2015 12:51 PM, Tim Dunphy wrote:
> > Hey guys,
> >
> >  I'm trying to echo my password into some commands inside of a bash
> script.
> > But I think I'm going about it incorrectly.
> >
> > Here's the top part of my script:
> >
> > #!/bin/bash
> > pub="~/.ssh/id_rsa.pub"
> > dps_pass="my_pass"
> > ssh="/usr/bin/ssh"
> > scp="/usr/bin/scp"
> > for i in 10.10.10.2{5,6}
> > do
> > echo "xfring key up"
> > echo $dps_pass |  $scp $PUB  digitalplatform@$i:
> >
> >
> > And here's how it executes:
> >
> >  #bash -x deploy_key.sh
> > + pub='~/.ssh/id_rsa.pub'
> > 
> > + ssh=/usr/bin/ssh
> > + scp=/usr/bin/scp
> > + for i in 10.10.10.2{5.6}
> > + echo 'xfring key up'
> > xfring key up
> > + echo 'my_pass'
> > + /usr/bin/scp /Users/my_user/.ssh/id_rsa.pub
> digitalplatform@10.10.10.25:
> > Password:
> >
> > Can someone please let me know where I'm going wrong?
> >
> > Thanks
> > Tim
>
> I don't think you can have utilities like ssh/scp take in passwd from an
> echo on the command line.
> I'd also suggest you change your password(s) based on the  line
> above ... from your original email.
>
> if you really want to do something like this, I'd suggest expect as the
> scripting language.
>
> --
> public gpg key id: AE60F64C
>
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Shell Script Help

2013-09-06 Thread Marc Wiatrowski
On Fri, Sep 6, 2013 at 8:44 AM, Nicolas Thierry-Mieg <
nicolas.thierry-m...@imag.fr> wrote:

> Matt wrote:
> > I have a script file in my cron.hourly that contains a good number of
> > scripts I must call.
> >
> > #!/bin/sh
> >
> > sleep 15
> > perl /scripts/create_graph.pl &
> >
> > sleep 15
> > perl /scripts/create_graph_out.pl &
> >
> > many more lines. etc.
> >
> > Is there a way I can sleep random length to time before executing each
> > but background each one so master script returns promptly.  Something
> > like.
>
> sleep 15 && perl /scripts/create_graph.pl &
> should return promptly, another reply addresses the random part.
>
>

 sleep $(($RANDOM%300))
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] scp with tty

2009-10-13 Thread Marc Wiatrowski
What about disabling the tty requirement for sudo with '!requiretty' in your
/etc/sudoers setup?

On Mon, Oct 12, 2009 at 12:11 PM,  wrote:

>
> Hello
>
> I need to know a way to have scp allocate a tty on a remote machine
> so I can have it run sudo and activate a vpn which it will need to
> activate. scp with "-S" does not work. I can't chmod +s the cisco vpn
> client
> because when I try to run it it says it can not have setuser.
>
> I could have the user scp via root but I do not want to do that.
>
> Any way to have scp allocate a tty?
>
>
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] nfs mounted /home and selinux

2008-10-30 Thread Marc Wiatrowski
I'm trying to set the context on an nfs mounted /home.  I believe
exactly like in Redhat's Deployment Guide at

http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deployment_Guide/ch45s02s03.html


On my system running CentOS 5.2:

$ ls -alZ /home
drwxr-xr-x  root root system_u:object_r:home_root_t.
drwxr-xr-x  root root system_u:object_r:root_t ..

$ mount -t nfs -o context=user_u:object_r:user_home_dir_t \
 server001a:/vol/vol01/home /home

$ ls -alZ /home
drwxrwxr-x  root rootsystem_u:object_r:nfs_t  .
drwxr-xr-x  root rootsystem_u:object_r:root_t ..
drwx--  fred users   system_u:object_r:nfs_t  fred
drwx--  mike users   system_u:object_r:nfs_t  mike
drwx--  aliceusers   system_u:object_r:nfs_t  alice

$ mount -l
server001a:/vol01/home on /home type nfs
(rw,context="user_u:object_r:user_home_dir_t:s0",addr=10.1.1.11)


Shouldn't the users be set to user_u:object_r:user_home_dir_t?  I feel
like I am missing something simple...

I don't see any avc or related syslog messages and the nfs server is an
older netapp if that matters.

thanks,
marc

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] dmidecode for CentOS 2.1? [hardware serial number and type]

2008-04-25 Thread Marc Wiatrowski

http://dag.wieers.com/rpm/packages/lshw/lshw-2.08.01-1.el2.rf.i386.rpm

Should work


On Fri, 2008-04-25 at 13:30 +0200, Simon Jolle wrote:

> Hi CentOS users
> 
> I have here old CentOS 2.1 server on IBM Xseries 336. How to see
> serial number and machine type?
> 
> It seems that "dmidecode" is not available for CentOS 2.1
> 
> cheers
> Simon
> 
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] aide questions, please

2008-04-09 Thread Marc Wiatrowski
I think those errors are because selinux is off.

On Wed, 2008-04-09 at 12:12 -0400, Jim Perrin wrote:

> On Wed, Apr 9, 2008 at 12:03 PM, Steve Campbell <[EMAIL PROTECTED]> wrote:
> >  Thanks Jim,
> >
> >  Believe it or not, that's what I started out with.
> >
> >  After running the entire --init/--check scenario again, I see in the log
> > files and the output, that all files get this message, and a normal output
> > of what should be there showing changed and unchanged files appear at the
> > bottom of the log. So what is this "lgetfilecon_raw failed for" showing up
> > for each file saying to me? Is it a verbosity setting, or something like
> > that?
> 
> Mostly it's telling you that it can't get all the information about
> the files it's checking. Are you doing this as root? Are you certain
> that selinux is off? Have you modified any of the mount parameters
> with noexec or anything else?
> 
> 
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem running a setuid Perl script on CentOS 4.5

2007-11-16 Thread Marc Wiatrowski

On Fri, 2007-11-16 at 09:42 -0500, Alfred von Campe wrote:
> I'm trying to create a setuid Perl script (yes, I am aware about the  
> security implications), but am getting this error:
> 
>% cat testsetuid.pl
>#!/usr/bin/perl -UT
>print "My real user id is $< but my effective user id is $>\n";
>exit(0);
>% ./testsetuid.pl
>Can't do setuid (cannot exec sperl)
> 
> I am using the stock Perl that came with CentOS 4.5.  The problem I  
> am trying to solve is to run a software build as a particular user.   
> We want any user to be able to submit a build job that runs on the  
> build machine as the designated build user.  If there is a better way  
> to do this, I'm open to suggestions.
> 
> Alfred

Being aware of the security implications, do you have
perl-suidperl-X.rpm installed?



___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos