Search Results

Search: Posts Made By: Nicol
5,492
Posted By Nicol
:b: it works also for me with the "sudo -S"...
:b:

it works also for me with the "sudo -S" , great thank to you.

i think it's impossible to have the password invisible in this case !

best regards
christian

---------- Post updated...
5,492
Posted By Nicol
hi ==> because the security doesn't...
hi


==> because the security doesn't accept it , we are forced to log with names user


==> it is , the keys have been created without password , this is the "ssh -t" that force to type...
5,492
Posted By Nicol
thanks for all, i've done all that and it...
thanks for all,

i've done all that and it works in all the cases except the case with the crontab command

With the keys installed i run with success without password :

ssh myuser@host1 "ls...
5,492
Posted By Nicol
well thank you to worry about my password. ...
well thank you to worry about my password.

It won't be visible because i will type it as the script begin to run.
This script will connect more than 100 machines and i don't want to type it each...
5,492
Posted By Nicol
..but how to try it ? echo -e "password\n" |...
..but how to try it ?

echo -e "password\n" | sudo -S ssh -t myuser@host1 "sudo -u newuser crontab -l"

thanks
Christian
5,492
Posted By Nicol
hi, no ideas anymore? i've tried to...
hi,

no ideas anymore?

i've tried to resume the difficulties , i know it's quite special

Christian
5,492
Posted By Nicol
Thanks for your help but definitly i can't ask...
Thanks for your help but definitly i can't ask for a modification of sudoers.

I resume:

i have to ssh more than 100 machines using a:

ssh -t myuser@host1 "sudo -u newuser crontab -l"

if...
5,492
Posted By Nicol
hi, well , if i say i can't ask , that's all...
hi,

well , if i say i can't ask , that's all i will not ask.

..... sorry i don't understand what you say "vbe" !

Christian
5,492
Posted By Nicol
The "ssh session " is asking the password once. ...
The "ssh session " is asking the password once.

but i need to answer it automatically with the script because i chain many ssh commands

Christian
5,492
Posted By Nicol
well i'm just a user not an admin , i can't ask...
well i'm just a user not an admin , i can't ask to change "sudoers"

i would just catch the question "Mot de passe...."
and answering it.

thanks
Christian
5,492
Posted By Nicol
ssh -t answering automatically to the password
hi,

i'm using the folowing ssh command to list the newuser "crontab' from myuser

ssh -t myuser@host1 "sudo -u newuser crontab -l"

this is ok but it is asking me a password.

Mot de passe...
3,459
Posted By Nicol
Thanks for all , it works : ssh -t...
Thanks for all , it works :

ssh -t newuser@server echo "': > /var/spool/mail/user1'" '|' sudo -u user1 /bin/sh

regards
Christian
3,459
Posted By Nicol
same result with the ">" regards ...
same result with the ">"

regards
Christian
3,459
Posted By Nicol
Well the "cp /dev/null" is ok but seems to be...
Well the "cp /dev/null" is ok but seems to be dangerous...

and the last solution gives this result



thanks for your help

Christian
3,459
Posted By Nicol
thanks for your perseverance ! the command...
thanks for your perseverance !

the command is ok but it does nothing at all , surprising !

# ssh -t newuser@server "sudo -u user1 echo -n /var/spool/mail/user1"

# ssh -t newuser@server ...
3,459
Posted By Nicol
In that case it is trying to create the file by...
In that case it is trying to create the file by redirecting the sudo :!
ksh: cannot create /var/spool/mail/notes03: Permission denied

i want to use the ">" as a command to erase the file because...
3,459
Posted By Nicol
but this is what i want : connecting by SSH...
but this is what i want :

connecting by SSH using sudo :

ssh -t newuser@server "sudo -u user1

then running the ">" to erase the mail file :

> /var/spool/mail/user1

with the rsh this...
3,459
Posted By Nicol
ssh and redirection
hi,

i was using with success the following rsh statement :

rsh server -l user1 "> /var/spool/mail/user1"

to clear all the mail by remote

now i try to do the same with ssh without success...
1,737
Posted By Nicol
thanks i prefer the awk because i can...
thanks

i prefer the awk because i can chained multiple cases of $CMD

regards
Christian:b:
1,737
Posted By Nicol
Thanks it works, i'm taking into account...
Thanks it works,

i'm taking into account your remarks but i'm "scripter" from time to time so....
"awk" neeeds a complete training i think

thanks a lot:b:
1,737
Posted By Nicol
Thanks to try to help me but , i think i'm not...
Thanks to try to help me but , i think i'm not clear.

There are 2 variables in input , if i say the input is :
/users/notes01/dir1

in fact it is :
/users/notes$NUM/dir1

so in a script i...
1,233
Posted By Nicol
Well the code is ok except that the original...
Well the code is ok except that the original value of the input file :
$LOGCOM * 5

is not translated
we should have the original value of LOGCOM in the variable REP_PERE

this script is...
1,233
Posted By Nicol
Variable expression and while
hi,

i'm reading a file "LISTE_FILE" like :

#
$LOGCOM * 5
$PRCCOM * 10

and i want to use the file with "while" and having the fields splitted into new variables for treatment :

while...
1,737
Posted By Nicol
Thanks for your help my request was just an...
Thanks for your help

my request was just an exemple

the input is CMD="/users/notes01"
but could be also CMD="/users/notes01/dir1"

and i want to convert it with a variable to
...
1,737
Posted By Nicol
awk and variable
hi,

i want to replace a string of characters by a part of this string plus a value:

CMD="/users/notes01"
NOSERVEUR=03

CMD2=`echo $CMD|awk '{ if ( $0 ~ /notes01/ )
{...
Showing results 1 to 25 of 181

 
All times are GMT -4. The time now is 01:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy