Might be that the MAIL variable is set by login(1) and later changed by a line in /etc/profile or ~/.profile (for ksh/bash/sh). Try sourcing your profile ahead of the command, eg.
I am using KSH and I need to check whether the remote host has been configured with ssh public key. Is there any way we can check inside a script? (6 Replies)
Hi,
Not sure if this is possible, I have a server (SERVER1) that is currently set up as a remote SSH host. My client SSH host (SERVER2) is connecting to SERVER1 to scp a file with no password.
I now have a need to set up a third server (SERVER3) as a remote SSH host and I need SERVER1 as a... (4 Replies)
i want a script with expect or perl or shell which will do ssh to remote host...it will take commandline argument and run the script in remote host.......
i.e that will be like ./ssh.exp remoteip username passwd /tmp.kk.sh
can someone help me on this? (1 Reply)
server is ok, I can login on console. however, when I use SSH teachia, there is no repsond.
i have check ps-ef | grep ssh, it shows ok. restart ssh too. still not working.
Anything else I need to check?
# ps -ef | grep ssh
root 24706 1 0 Jun 12 ? 0:00... (7 Replies)
Hi all
I wrote a script to execute a script on several remote hosts, but somehow during the execution of the local script, ssh can't come back from the remote host, so that causes my local script hanging... I use the below command to do the job in the local script, any idea?
ssh... (12 Replies)
I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1.
When I do a who -m from A2, I see the "connected from" as "A1".
=> who -m
userid pts/2 2010-03-27 08:47 (A1)
I want to identify who is the local host who initiated the connection to... (3 Replies)
Hi all,
I have a problem where i'm trying to identify on which remote hosts the apps are running, ssh into it and restart them.
In case more than 1 apps is running on same remote host, i want to be able to group it and ssh only once.
E.g:
app1 = 1.1.1.1
app2 = 1.1.1.2
app3 =... (4 Replies)
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)
I am trying to connect to a remote host C from my node host A.
HostA <====> HostB <====> HostC
A tunnel has already been formed using SOCKS5 between HostA and HostC.
Now I want to SSH from A to C. The SOCKS5 IP us 142.133.132.161 and port 1082.
The command I am using is :
ssh -L... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies
LEARN ABOUT LINUX
ssh-socks5-proxy-connect
ssh-socks5-proxy-connect(1) User Commands ssh-socks5-proxy-connect(1)NAME
ssh-socks5-proxy-connect - Secure Shell proxy for SOCKS5
SYNOPSIS
/usr/lib/ssh/ssh-socks5-proxy-connect [-h socks5_proxy_host] [-p socks5_proxy_port] connect_host connect_port
DESCRIPTION
A proxy command for ssh(1) that uses SOCKS5 (RFC 1928). Typical use is where connections external to a network are only allowed via a socks
gateway server.
This proxy command does not provide any of the SOCKS5 authentication mechanisms defined in RFC 1928. Only anonymous connections are possi-
ble.
OPTIONS
The following options are supported:
-h socks5_proxy_host Specifies the proxy web server through which to connect. Overrides the SOCKS5_SERVER environment variable.
-p socks5_proxy_port Specifies the port on which the proxy web server runs. If not specified, port 80 is assumed. Overrides the
SOCKS5_PORT environment variable.
OPERANDS
The following operands are supported:
socks5_proxy_host The host name or IP address (IPv4 or IPv6) of the proxy.
socks5_proxy_port The numeric port number to connect to on socks5_proxy_host.
connect_host The name of the remote host to which the socks gateway is to connect you.
connect_port The numeric port number of the socks gateway to connect you to on connect_host.
EXAMPLES
The recommended way to use a proxy connection command is to configure the ProxyCommand in ssh_config(4) (see Example 1 and Example 2).
Example 3 shows how the proxy command can be specified on the command line when running ssh(1).
Example 1: Setting the proxy from the environment
The following example uses ssh-socks5-proxy-connect in ssh_config(4) when the proxy is set from the environment:
Host playtime.foo.com
ProxyCommand /usr/lib/ssh/ssh-socks5-proxy-connect
playtime.foo.com 22
Example 2: Overriding proxy environment variables
The following example uses ssh-socks5-proxy-connect in ssh_config(4) to override (or if not set) proxy environment variables:
Host playtime.foo.com
ProxyCommand /usr/lib/ssh/ssh-socks5-proxy-connect -h socks-gw
-p 1080 playtime.foo.com 22
Example 3: Using the command line
The following example uses ssh-socks5-proxy-connect from the ssh(1) command line:
example$ ssh -o'ProxyCommand=/usr/lib/ssh/ssh-socks5-proxy-connect
-h socks-gw -p 1080 playtime.foo.com 22' playtime.foo.com
ENVIRONMENT VARIABLES
SOCKS5_SERVER Takes socks5_proxy_host operand to specify the default proxy host.
SOCKS5_PORT Takes socks5_proxy_port operand to specify the default proxy port.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWsshu |
+-----------------------------+-----------------------------+
|Interface Stability |Stable |
+-----------------------------+-----------------------------+
SEE ALSO ssh(1), ssh-http-proxy-connect(1), ssh_config(4), attributes(5)SunOS 5.10 30 Oct 2002 ssh-socks5-proxy-connect(1)