SSH (Secure SHell) is a protocol for running commands on a remote computer.

learn more… | top users | synonyms

5
votes
1answer
98 views

Linux: $SSH_CONNECTION is set even without SSHing to the server

I have a remote server and I am writing a script in the server and want it to fire only when I SSH. I thought of using the $SSH_CONNECTION and $SSH_TTY for this purpose. I found out that when I have ...
2
votes
2answers
65 views

Call the script after disconnecting from server

I have a script I made for work that will call a function that takes an argument. I use the arguments to ssh into our servers. My question is: Is there a way to call the method so that if/when I get ...
2
votes
0answers
175 views

Cannot connect to ssh server

I am having trouble connecting to my ssh server. It responds with a lengthy error message about no network etc. but it is the last message that concerns me: Sometimes, such troubles can be caused ...
3
votes
2answers
130 views

transfer a file to remote dir only if doesn't exist without replacing

I'm using CentOS linux. In one line cmd, that returns 0 if success, non-0 if failure, I need: Transfer a file to a remote server. Don't transfer the file if filename exists in remote server ...
5
votes
1answer
476 views

Need to ssh from one Amazon EC2 server into another one

Basically I need to be able to connect from one EC2 instance to another using SSH. I run the command ssh -i path-to-pem-file ec2-user@dns-address-of-ec2-instance, and it times out. I set my security ...
5
votes
1answer
242 views

2 Factor Authentication in SSH using public key and PAM

I'm trying to setup 2 Factor Authentication. I want the user to login successfully if: The public private/public key matches (authentication method: publickey) or the password is correct My pam ...
6
votes
1answer
195 views

ssh from linux into mac - permission denied

I'm running a Oracle Linux VM on a Windows 7 host and I'm trying to ssh into my MacBook. I've already created the private/pub keys in my Mac. I have copied the id_rsa.pub contents into the ...
2
votes
1answer
226 views

How to change ssh log location from /var/log/secure to custom location in rhel 6?

By default in RHEL 6, SSH server logs are sent to /var/log/secure. I want to change this location to a custom one. Is it possible to do that? I have tried modifying the rsyslog.conf file, but it does ...
2
votes
2answers
520 views

Copy ssh public key to multiple Linux hosts

I am trying to copy .ssh/id_rsa.pub from our central server to multiple servers. I have the following script which I usually use to push changes to the different servers. #!/bin/bash for ip in ...
3
votes
1answer
142 views

Restricted ssh remote execution with arguments

I need to enable remote execution of a shell script on a server, but deny all other access. The script is a toggle that accepts a single parameter (on/off/status). This comes close to answering my ...
2
votes
2answers
225 views

Piping tcpdump traffic via SSH - but no root ssh access

The situation I would like to use Wireshark to analyze traffic on one of our servers, but I don't want to install Wireshark on the server itself. I understand that I can pipe tcpdump traffic via SSH ...
1
vote
1answer
47 views

ajaxterm using proportional font

I have Ubuntu 14.04 LTS, Apache 2.4.7, Python 2.7.6 and Ajaxterm 0.10-12ubuntu1. Ajaxterm is proxied via Apache. Here's the apache.conf excerpt: # Suppresses the Via header ProxyVia Off # Do not ...
17
votes
2answers
441 views

What's the purpose of the randomart image for user (not host) SSH keys?

The ssh-keygen generates the following output: The key fingerprint is: dd:e7:25:b3:e2:5b:d9:f0:25:28:9d:50:a2:c9:44:97 user@machine The key's randomart image is: +--[ RSA 2048]----+ | .o o.. ...
1
vote
0answers
181 views

Have tmux wait until I SSH in, to complete rest of Tmuxinator script

After recently discovering tmux and Tmuxinator, I've been trying to set up a development environment to use. Per protocol, we aren't allowed to store passwords/passphrases in scripts. So what I'm ...
2
votes
2answers
145 views

Ctrl-S doesn't work in rtorrent when accessed via screen. Can't start torrents

I run rtorrent remotely on a seedbox. When I log in with a web interface I'm able to start torrents, and when torrent files get dropped into my watched folder that works too. However, when I try to ...
-4
votes
1answer
59 views

connect remote host without password in linux [duplicate]

Am trying to connect remote host by using ssh: ssh xxxx@hostname. It will connect by asking password. But I need to connect host with out password.
2
votes
1answer
136 views

vim: Use different colorscheme when connected over SSH

On my desktop I use the hbrid color scheme in vim, with the preferred colors set for my consoles 16-color palette (as described in the README). However, on my laptop, I use the solarized color ...
1
vote
0answers
132 views

ssh from an unix server to a windows server (running Sysax) fails

We are doing a sFTP from an Unix server to a Windows server and also a ssh, from the Unix server to the Windows server, to execute a file present on the Windows server. These 2 steps worked well. ...
7
votes
3answers
560 views

Run a diff between local and remote file

I'm connected on a host via ssh and I'd like to compare (let's say with diff) a certain config file against its counterpart on another host, also accessible via ssh, without having to manually ...
2
votes
1answer
100 views

SSH config file + shell script help

Well, what I want to do seems a bit convoluted but its the only way I can think of to get the result I want. So here goes. I want to automate ssh to my Pi, in the following fashion: My Pi boots up ...
2
votes
2answers
127 views

Allow multiple remote connections to an ssh Dynamic forwarded port

Let us assume I have three machines A - Server to which I am sshing to B - Client from which I am sshing C - Another Client in B's subnet Now, I set up dynamic port forwarding for port 1235 by ...
1
vote
1answer
464 views

Password-Less SSH Login not working [closed]

I create a SSH Key file on Server A using RSA method ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_rsa): Enter passphrase (empty ...
1
vote
2answers
73 views

Reject ssh connections made from proxies

I was seeing this question which was concerned with blocking access to the users who do not belong to a particular region. I am sure that blocking is possible but I see there is a workaround to this. ...
1
vote
1answer
181 views

DROP all for port 22 if not geoip set of US for iptables and xtables

I want to simply block all ssh access from anywhere but with in the US. This is my whole iptables, and I have followed ...
0
votes
3answers
35 views

Is there a log for sshd where I can see who has used ssh to access my PC? [duplicate]

I am running the OpenSSH daemon (sshd) on CrunchBang Linux, and I want to see a history of who (i.e. IP address) has logged in using SSH.
1
vote
1answer
37 views

CentOS 6.4: SSH RSA key issue, “[…]== rsa-key-20140711\n failed”

For some reason sshd is reading from my authorized_keys file a new line that does not exist. I generated the keys with puttygen, copied the public key text in as required, concatenated the key into ...
1
vote
0answers
88 views

SSH Agent Forwarding on server

I'm struggling with the concept of SSH Agent Forwarding. This is what I've done so far: Create default identity local (ssh-keygen) Install the public key on bitbucket Now I want to connect to a ...
1
vote
2answers
135 views

Locked myself out of Amazon EC2 SSH - This service allows sftp connections only

Doh. Locked myself out of SSH on an Amazon EC2 box after fiddling with ForceCommand internal-sftp in /etc/ssh/sshd_config in order to allow root log-in via SFTP. SFTP still works fine, but PuTTY ...
3
votes
3answers
115 views

Monitor all login attempts

Few weeks ago I thought it would be a good idea to write a script to send me an email whenever some user logs in into my server. So I came with a perfectly working script notifyLogin.sh, then I ...
4
votes
0answers
610 views

Can't figure out why ssh_exchange_identification: Connection closed by remote host appear

At home, I have setup a Raspberry Pi with the latest version of Raspbian and with ssh enabled. I also use a Mac Book Pro with OS X 10.9.3. I use ssh pi@192.168.0.22 to do some work on the Raspberry ...
1
vote
0answers
145 views

sudo -u git clone

I'm on Ubuntu server 14.04. I am using apache web server which runs as the www-data. I need to do git clone from a script (a web hook). This script will run with www-data user privilages. Running ...
0
votes
5answers
89 views

Downloading file through SSH with a “proxy” machine inbetween

I need to download a file from machine C to machine A. To do that, I need to login to machine B (I am doing this using scp), as I cannot access C directly from A. Would it be possible to download a ...
1
vote
1answer
24 views

SSH and certificates - how to connect?

My geeky friend has dropped me this message: Debian instance has been created for you with IP address of 10.5.0.95. Remember: To connect to it, you need the certificate: ssh -i xxx.xxx ...
2
votes
1answer
34 views

ssh -X foo@host then su bar then run X app with local display, while bar also logged in?

I want to ssh into another machine, using one user account, then su to another user and run X programs as that user, with the display on my computer. The case when the 2nd user is not logged in to X ...
0
votes
2answers
76 views

Locale not being set on initial login on Raspbian/Debian

When I log in to my headless Raspbian box using putty/ssh, the locale is not being set correctly. However, if I su to another user, then su back, the locales are then set. This session shows the ...
1
vote
2answers
482 views

Shell Script - how to scp into remote server and download files and protect password

I have a remote server that I need to download Apache logs from. I can manually scp into the server and get the files, but I'd like to put this in crontab. The only way to automate it is to include ...
3
votes
0answers
130 views

Can't get SSH working anymore on Debian after upgrade

I have a vServer and can only login via SSH. After the latest apt-get upgrade command, I can't login anymore and get the following error message: "Network error: Connection refused". It seems that ...
2
votes
1answer
122 views

Bash Script Display Remote Screen Session to User

I'm kind of new to bash scripting and I'm having trouble figuring out how to accomplish this. I'm working on a script that is designed to backup and manage a java application that runs within a ...
4
votes
1answer
137 views

Remotely turn off display output?

I'm using x11vnc and SSH to tunnel VNC remotely to my local machine. One of the interesting side-effects of this is that as I use my work computer from home, my coworkers will see me moving around ...
3
votes
5answers
164 views

Securely tunnel port through intermediate host

I'm looking to route a port for VNC back to my house here. I have to jump over a single host to then hop to my actual work machine. sittinghere will be my local home machine hopper will by the ...
0
votes
0answers
45 views

Cannot open GUI's via SSH connection? [duplicate]

I've just connected to a Linux terminal using an ssh client. I'm running Linux on both desktops, but cannot open PDFs, IDE, or other graphics from the ssh client. How can I fix this?
1
vote
1answer
67 views

SSH slow after configuring TCP Wrappers

We have SSH open on one of our production servers leaving it prone to various brute force attacks to break in. I reduced the attempts by changing the default port from 22. I want to further harden ...
8
votes
1answer
426 views

Using SSH to connect to a new server without storing the host keys in the $HOME/.ssh/known_host file

I get the following output if I run the following command: -bash-3.2$ ssh -o "StrictHostKeyChecking no" 192.168.1.77 Warning: Permanently added '192.168.1.77' (RSA) to the list of known hosts. Last ...
3
votes
1answer
638 views

SCP Lost Connection

I can successfully connect to my server via ssh but when trying to run the scp command I get a connection time out. $ scp ~/.ssh/id_rsa.pub root@192.168.12.2:id_rsa.pub ssh: connect to host ...
0
votes
1answer
41 views

Backup of data from Linux PC [duplicate]

I have Linux PC, for which monitor is not working. But I am able to log in through SSH. I want to take a backup of all the directories from this PC. Instead of changing directories one by one and ...
2
votes
3answers
52 views

force ssh to change dir after login based on config

Is there any way to force ssh to change it's working dir in ~/.ssh/config or by using other configuration files? I have a lot of servers with different environments. Each environment is installed in ...
2
votes
1answer
47 views

SSH'd into a computer, uptime / who / users report 0 users?

I'm ssh'd into a server. Why doesn't the server report it? # uptime 21:54:28 up 13 days, 3:47, 0 users, load average: 1.18, 1.11, 1.13 # users # who I'm not really sure I understand it ...
3
votes
0answers
207 views

SSH AuthorizedKeysCommand and SELinux

I'm trying to use the SSH AuthorizedKeysCommand in a CentOS 6.5 machine, but I'm encountering an SELinux error. When I switch SELinux to permissive mode - using setenforce 0 - it works, but when I ...
4
votes
1answer
1k views

Executing commands with ssh and shell script using variables on a remote machine

I'd like to execute a command and script located on a remote machine with a script on a local machine. I know it's possible to execute these kind of commands with ssh, so I made: #!/bin/bash ssh ...
5
votes
1answer
99 views

Why does ssh -g say that address is already in use?

I setup an SSH connection with port forwarding that allows remote hosts to connect to the local forwarded ports like this: ssh -g -L 5115:localhost:5115 <server> The connection works fine ...