Another option, without actually removing the newline, but printing without it:
(in your command, date is running on the local host, which may or may not be the same as the remote host, you'd need add quotes to change that)
Hi guys,
I am trying to do a ssh for performing a set of actions.
Find it below:
I need to put the user/ kernel/ DISTRO variables before I complete this operation.
what I observed is when ever I put a `command` in those quotes, it performs thta action in local system rather than remote one.... (5 Replies)
Hello sir,
Im using ubuntu distro.
We all know that ssh is used for password less entry.So, I have the public key and the IP address and the username thats it. Now to login it to the system either I should have password or a private key.Now I have the blacklist of private/public keys. But I dont... (1 Reply)
i have a bash script on serverA, when i run the script on the server, it runs fine. the way to run the script is like this ./script "option1"
Now i am trying to call it from local laptop using ssh command, my command is as the following
ssh serverA ~/script "option1"
and i got error... (7 Replies)
Hi all,
Scenario - trying to run a batch job on a second machine.
DIR=directory
user=user
server=server
Here is what i have- ssh user@server 'sleep2; cd $DIR; <jobname>'
I have got access to the correct directory, i checked with a pwd command previous.
Problem is the job i... (1 Reply)
Hi,
i have a shellscript, where in i need to connect to different server start these three jobs and exit from the server and start the same three jobs on local server.
ssh user@remotehost 'bash -s' << EOF
${GETT_HOME}/bin/start1 &
sleep 10
${GETT_HOME}/bin/start2 &
sleep 10... (1 Reply)
Hi, I've an issue in a shell script:
I'm opening an ssh connection to a remote server, then I want to store the result of a ls command in a variable, but it doesn't work: the ls is done on the local machine.
ssh user@server << EOF
ls # works as expected (ls is done remotely)
test=`ls` # the... (1 Reply)
How should i make the following code working
#!/bin/bash
INPUTFILE="test.txt"
while read STRING; do
IP=`host -t A $STRING | awk '{print $NF}'`
HOSTNAME=`ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no $IP "hostname"`
echo $HOSTNAME > out.txt
done < $INPUTFILE
At this moment while... (3 Replies)
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)
I have a variable called $a1 which maps to something like "http://servername proxy1 count http" and a lots of entries in a file on remote server.
If I have the following in my .sh script:
sed -i "\%$a1%d" mylog.txtthe line is deleted from mylog.txt. Great.
I'm trying now to remvoe this from a... (3 Replies)
Discussion started by: say170
3 Replies
LEARN ABOUT NETBSD
rusers
RUSERS(1) BSD General Commands Manual RUSERS(1)NAME
rusers -- who is logged in to machines on local network
SYNOPSIS
rusers [-al] [host ...]
DESCRIPTION
The rusers command produces output similar to who(1), but for the list of hosts or all machines on the local network. For each host respond-
ing to the rusers query, the hostname with the names of the users currently logged on is printed on each line. The rusers command will wait
for one minute to catch late responders.
The following options are available:
-a Print all machines responding even if no one is currently logged in.
-l Print a long format listing. This includes the user name, host name, tty that the user is logged in to, the date and time the user
logged in, the idle time (in minutes), and the remote host they logged in from (if applicable).
DIAGNOSTICS
rusers: RPC: Program not registered
The rpc.rusersd(8) daemon has not been started on the remote host.
rusers: RPC: Timed out
A communication error occurred. Either the network is excessively congested, or the rpc.rusersd(8) daemon has terminated on the
remote host.
rusers: RPC: Port mapper failure - RPC: Timed out
The remote host is not running the portmapper (see rpcbind(8)), and cannot accommodate any RPC-based services. The host may be down.
SEE ALSO rwho(1), users(1), who(1), rpc.rusersd(8), rpcbind(8)HISTORY
The rusers command appeared in SunOS.
BUGS
The sorting options are not implemented.
BSD April 23, 1991 BSD