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

learn more… | top users | synonyms

7
votes
1answer
2k views

Nested ssh session inside screen has no color

I am attempting to keep a nested ssh session inside of a byobu/screen window, which I also connect to over SSH with Putty on Windows. However the nested SSH session has no color. Here's what I'm ...
7
votes
3answers
13k views

ssh, start a specific shell, and run a command on the remote machine?

I am in a situation where several users are sharing the same user account on a remote machine. I have a "personal" directory where I wrote my own .zshrc file, and I would like to have a way to: ...
7
votes
3answers
354 views

OpenSSH - map aliases in ~/.ssh/config to IP addresses in command line

Is it possible to query ~/.ssh/config in the command line? Let's say I would like to retrieve what IP address does the particular alias point to in a separate program, is it possible?
6
votes
3answers
20k views

How to make putty to not break my session after some time?

Each time putty is breaking session after some time if I am doing nothing. There is no any time parameter on putty so how can I stay my putty ssh session always Alive ?
6
votes
3answers
24k views

Shell Script for logging into a ssh server

I tried writing a shell script which can do automatic login into a ssh server using password which is mentioned in the script. I have written the following code: set timeout 30 /usr/bin/ssh -p 8484 ...
6
votes
4answers
4k views

How do I connect to a pc through another pc using ssh

I have three Computers. PC1 and PC2 is on a private LAN, where PC1 is known to PC2 as 192.168.0.2 PC2 and PC3 is on a another LAN, where PC2 is known to PC3 as 192.168.123.101 How can I connect to ...
6
votes
4answers
344 views

SSH “sleeping” for a long time before connect? [duplicate]

Possible Duplicate: How to speed my too-slow ssh login? I have a very strange issue with my SSH server. Whenever I attempt to connect, it literally waits about 30 seconds to a minute before ...
6
votes
3answers
376 views

Remote ls on multiple machines

I want to connect to multiple machines specified in a file and perform 'ls' there. That's what I've come up with: for machine in $(cat machines) do echo "Connecting to " $machine ssh $machine ...
6
votes
5answers
2k views

How to effectively use screen and SSH?

I'd like to configure SSH and screen such that a login will always reattach to a screen session. Ideally, that session would not quit but detach when I press C-d. How can this be achieved? And what ...
6
votes
2answers
10k views

How to ssh to a server using another server? [duplicate]

Possible Duplicate: ssh via multiple hosts For connecting to server B I have to first ssh to server A. What's the command line to access server B?
6
votes
3answers
14k views

How to write a bash script, that logs onto an other machine to do stuff?

Is it possible to write a bash script, that would be started from machine A, logs in on a different machine B by ssh (both machines A and B would be Linux-Machines), copys some files on to machine B ...
6
votes
3answers
1k views

Is there any disadvantage in using SSHFS instead of SSH alone?

I find it easier to use SSHFS to mount a remote file system on my local computer instead of plainly SSH'ing into the remote computer. This saves me from using all the complicated scp commmands for ...
6
votes
1answer
456 views

Why ssh does not turn terminal title back?

As you might know, when you ssh to a server from an X terminal (rxvt, gnome-terminal...), ssh changes the window title to reflect user@host, but it does not change it back. There are many tips how to ...
6
votes
3answers
15k views

How to pull a file from a server using scp?

I am on machine A and want to pull a file from machine B. A$ scp <myuserid>@hostB:<path of file in B> . it says that: scp: <path of file in B>: No such file or directory But on ...
6
votes
2answers
537 views

Is it possible to use one SSH key per account for each account on a given remote server?

Suppose I have a number of accounts on a server called SERVER. Let's call them ACCOUNT1, ACCOUNT2 and ACCOUNT3. Suppose I don't want to have to type in the password for the account each time I ssh ...
6
votes
2answers
977 views

Should I be backing up my SSH host keys?

In my automated backups, I'm not sure if I should be doing this. If the hard drive fails or if I wipe the hard disk and start over, what will be the effect of starting with a new SSH host key to my ...
6
votes
2answers
5k views

Not able to ssh in to remote machine using shell script in Crontab

Below is the script which i am trying to run, which runs without any issue for i in `seq 200 2100` do usr=(`ssh -t -t -o ConnectTimeout=60 machine$1 finger | tail -1 | awk '{print$1}'`) echo ...
6
votes
1answer
766 views

How do I sftp to a server if the username contains @ symbol

I have to sftp to a server to a specific port but the username contains the @ symbol. suppose the user is "user@domain.com" and the ftp server is just "domain.com" I will end with sftp -oPort:8777 ...
6
votes
2answers
584 views

Special character '#' in Perl SSH command

I try to send command using SSH in my perl script with # but it gets truncated right at # Example: Input text is : $message = "Product ID # STK000134" The SSH command is : $execute=`ssh -q ...
6
votes
1answer
3k views

SSH over Socks proxy without username or password

I have a list of SOCKS proxy servers from this site. I've read about creating a dynamic tunnels with ssh -D and to be honest i've tried that already. Unfortunately for some reason I cannot connect to ...
6
votes
3answers
3k views

Are there disadvantages in SSH tunneling?

I recently "bought" a VPS that I want to use as a Proxy to be able to use some sites and stuff that I can't reach from germany. Since I was yet too lazy to set up Squid and OpenVPN (which I ...
6
votes
4answers
720 views

History of IP addresses that accesed a server via ssh

It has come to my attention that a server of mine has been hacked and infected with a known chinese botnet. It was a prototype/testing virtual machine with its own static IP(US address) so no harm ...
6
votes
2answers
699 views

Is it possible to break long lines in sshd_config?

Specifically AllowUsers parameter: e.g. convert this AllowUsers user1 user2 user3 user4 to this AllowUsers user1 user2 user3 user4
6
votes
3answers
528 views

Send an email any time an SSH key is used

I have about 30 nearly-identical CentOS 6 servers that I need to be able to push out updated config files automatically using an rsa key to log in as root. Usually this will just be rsync, but ...
6
votes
4answers
2k views

SSH authentication: either SSH keys or one time password

I have an Ubuntu 10.04 Linux server that I normally ssh into (from my home machine) using ssh key authentication. However, sometimes I need to ssh remotely from potentially insecure machines (like ...
6
votes
2answers
2k views

Can I set my local machine's terminal colors to use those of the machine I ssh into?

I have a color scheme that I like for when I'm in a terminal, but I ssh into the machine I work on from multiple sources (locally, PuTTY, my netbook, etc.) and I want to maintain the same color scheme ...
6
votes
4answers
1k views

Why do I need to hit enter to get my shell prompt after my init.d script completes?

I had to write my own CentOS init.d script for celery because it only ships with one for Debian. You can see the script I wrote when I answered my own stack overflow question 3989656. But there's a ...
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 ...
6
votes
2answers
598 views

Why not simply use %h in OpenSSH ssh's ControlPath option?

Why do the "ssh_config(5)" manpages recommend that the ControlPath option should contain at least the %h, %p and %r placeholders in order to uniquely identify each shared connection? I thought that ...
6
votes
1answer
5k views

X11 forwarding an OpenGL application from a machine running an NVIDIA card to a machine with an AMD card

I'm interested in forwarding an X11 session over SSH, in order to launch a remote process that utilizes OpenGL (specifically, gazebo for anyone familiar.) The problem that I seem to be running into ...
6
votes
1answer
215 views

Does fail2ban offer any additional protection to SSH if password login is already turned off?

I’m setting up a Debian VPS on Linode to use as a public web server, and I’m following their security suggestions. The last suggestion they make is to install fail2ban, to avoid dictionary attacks on ...
6
votes
2answers
1k views

SSH LocalCommand on exit

In ~/.ssh/config you can use the LocalCommand directive to execute a local command whenever you connect to a remote machine via SSH. But how do I execute a command when I exit an SSH connection? It ...
6
votes
2answers
2k views

Giving some users only SSH and shell access with limited resource usage

I'm trying to make a user that can access my server through SSH and allow it to have a shell, limited to using only, say screen and irssi. And it shouldn't it be able to see other directories except ...
6
votes
4answers
2k views

How to debug SSH port forwarding

This is an extension to ssh port forward to access my home machine from anywhere I tried things mentioned there but I am not able to ssh to my machine. Netgear router settings for port forwarding: ...
6
votes
2answers
674 views

Configuring a vncserver so it's only accessible from my ssh tunnel

Since I use vnc through an ssh tunnel, is there any way I can block the open vnc port that the remote machine is listening on without it affecting my ability to use the ssh tunnel? Both machines are ...
6
votes
2answers
20k views

How to add a ssh user who only has permissions to access specific folder?

How to add an ssh user who only has permissions to access specific folder? useradd -d /var/www/xyz.com.tr/musteri -s /bin/bash -g sshd musteri I created a user called musteri. I set its home ...
6
votes
3answers
3k views

A Web ssh/telnet client

I'm in kind of a tight spot right now. I wanted to know if someone has seen a HTML, or PHP web ssh client as both my company and school block everything besides port 80. I'm a control freak when it ...
6
votes
2answers
3k views

Why Bash unable to find command even if $PATH is specified properly?

I am specifying path to my command in the file /etc/profile: export PATH=$PATH:/usr/app/cpn/bin My command is located in: $ which ydisplay /usr/app/cpn/bin/ydisplay So, when I performing "echo ...
6
votes
3answers
451 views

firefox process dies after ssh log out on remote machine

I need to run firefox on a remote host via ssh and keep process running even after ssh logout. I already have tried these ways: nohup firefox & screen disown -h But it seems these work only ...
6
votes
1answer
2k views

How to use ssh-agent with multiple (valid) keys and yet choose which one to use?

Let's say there are two keys A and B, both of which are valid for user@host public key authentication. Since authorized_keys is configured for different behaviour depending on the key, ~/.ssh/config ...
6
votes
2answers
911 views

How to speed up X over fast connection ? (especially over ssh)

What are recommendations on speeding up X applications over local fast (gigabit) connections? (similar question for slow connections) Currently I'm running over ssh -Y, which is fine, but I wonder if ...
6
votes
2answers
2k views

working with filenames in a different encoding over ssh

I'm ssh'ing to a remote system where a different encoding for the filenames (and for the users' locales) has been used. And this causes some problems. Problems solved by matching the locale settings ...
6
votes
1answer
92 views

Work around two-factor SSH auth with Master connection and port forwarding?

The problem 1.0 I'm working on a server that only supports two-factor auth (keypair auth is disabled). So every time my SFTP client wants to upload a file, it asks me for a token... after 3 minutes ...
6
votes
2answers
479 views

Terminate dropped SSH sessions

My SSH sessions seem to be dropping though that is not my major problem - the major problem is my previous sessions are still alive, worse yet one of them is running visudo preventing me from ...
6
votes
1answer
199 views

Waiting until SSH tunnel (ssh -w) is set up before running command

When using SSH VPN tunnelling (-w option), is there a way to know when the tunnel is actually up? I want to use this in a script that automatically sets up the tunnel by running ssh -w then running ...
6
votes
1answer
146 views

Ssh audio redirection

I have DVB-T USB dongle plugged into my Linux server (GUI-less). It works correctly, but I want to stream TV programs from server to my PC. For this I use Kaffeine that way: ssh -X -p 666 -i ...
6
votes
1answer
105 views

Send only one warning when the private key is not available

For added security, I would like to require a private key to use sudo on my Ubuntu Server box. I've added private key authentication for sudo as described at ...
6
votes
2answers
8k views

X client forwarded over SSH “cannot open display: localhost:11.0”

I have enabled X forwarding on remote machine where SSH server is running: # grep -i forward /etc/ssh/sshd_config X11Forwarding yes # On local machine, I have started SSH client with -X flag ...
6
votes
2answers
468 views

ssh-agent: don't forward authentication for the whole keyring

I have two private ssh keys : one to access my personnal machines, one to access servers at my job. I add those two keys to my ssh-agent with ssh-add. Now, when I do ssh -A root@jobsrv I ...
6
votes
1answer
336 views

SSH session pauses mid datastream; resumes with a keypress

I've had this problem occur at random, intermittently, across boxes at multiple companies, multiple distros, and multiple kernel revs. I think that I'm just cursed. What happens is that I'll have a ...