I've noticed that when running a script that connects to a number of our servers (to essentially run batch commands) that the commands aren't logged in the user's .sh_history or .bash_history files. Is there a place where this is logged (assuming the script itself isn't doing the logging and I'm not tee'ing the output anywhere)?
I'm talking specifically about AIX, but I would assume this question applies to all the *nix flavors.
As a tag-along to this post, I often nohup these commands (like sendmail -bi) so the script can run through all the hosts quickly. What can I enter in the script to create one large nohup.out on the machine running the script that's reaching out to all the others?Right now I've got
but that failed miserably, I'm guessing that's because the nohup was given via an ssh and not in an interactive shell so nothing got logged?
As for the second part of my post, I ended up putting most of the script in one file that's now being called by a much shorter script that will tee the output to a log file. Its not elegant, but it does what I need it to as far as the logging goes.
Thanks Corona, looks like I've got some more reading to do
Hello i am having an issue with bash script and this is the code
now=$(cat hosts1.txt | awk '{print $2;}')
while read n ;do
ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers'
When i execute only part with cat, it... (8 Replies)
Geeks,
Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s).
Here's the complete... (5 Replies)
Hi All,
Sorry if it is a duplicate post. I have not got any reference about this anywhere.
I looked at the posts described in SSH - Passing Unix login passwords through shell scripts - Linux / UNIX Forum and it helped me till the point to connect to the host and executing the basic commands.... (3 Replies)
Hello,
I am trying to write log from sco box to a remote host.
We already have that setting working for linux server using syslog.
With this setting(on LINUX)
*.* @remote-host for sco I have this
*.debug /usr/adm/syslog
*.* ... (3 Replies)
Hi,
My requirement - for security purpose -
I want all root logins to my solaris servers are done by a script kept
in a separate unix box. This script will telnet into remote solaris server with
root user and log every session via log file.
Now my purpose is to log every telnet session... (3 Replies)
Hi all
I'm creating a script that runs a few commands on some boxes and everything can be logged EXCEPT the java -version command, there doesn't seem to be any output...
Can anyone help explain why this does not work? Do I need to do something extra to append the output from the java... (3 Replies)
Hi All,
I am using a script for remotely logging into a rhost using telnet and shutdown a server. The script is as follows.
IP = 10.24.12.23; export IP
UNAME = username ; export UNAME
PWD = password; export PWD
CRDIR = /etc/rc.d/init.d ; export CRDIR
echo "logging into remote... (4 Replies)
Hi, all
please help me this time@@!
I want to execute the shell on the server from the remote.
How can I do that and save the return code in the variable?
I want to execute the script on the ten servers at the same time... I'd like to find a fast method to solve it!
Thanks in advance! (3 Replies)
Hi,
I want to log-in to a remote server using shell script.
The server requires the following while allowing a connection:
username
password
one - letter authorisation.
How can i implement this in my script?
thanks,
abey (6 Replies)
Hello again!
When I log in to my computer (Ultra 5 running Solaris 8) from a pc (FTP or Telnet) I have to wait forever (about 30 seconds) before I can log in. Is this some kind of security thing? Can I turn it of? How?
Anders (8 Replies)