Secure Shell (SSH) is a protocol primarily for encrypted shell connections.

learn more… | top users | synonyms (2)

8
votes
2answers
8k views

How do I set default permissions for SFTP for an Ubuntu Server?

We have an Ubuntu 10.04 server. How can I set it so that new files created (or copied) over SFTP or SSH have g+rw and g+rwx permissions (where appropriate)? I'm also using setgid (chmod g+s) so that ...
8
votes
3answers
7k views

How can I use the same key for SSH and SSL (https)

I'm trying to install the development tools for a small team, and I can't get the authentication right. Since we are a distributed team, the server is on the internet. And I'd like to have SSO+zero ...
8
votes
4answers
4k views

When would ssh -t not be appropriate instead of ssh?

Using ssh -t instead of ssh for connections to remote servers has several advantages. For example, I can directly edit a file with vim: ssh -t host vim foo.txt, which would fail otherwise. Are there ...
4
votes
2answers
1k views

Easy multi-level authentication for sudo

I have a FreeBSD server with password-based SSH enabled. I would like to enable sudo, but I do not want a potential attacker to be one password away from root access. My current solution is logging ...
3
votes
11answers
845 views

Ubuntu Server SSH

I have a server with ubuntu. I do work on it over SSH. I had a problem with brute force attempts over port 22. I changed the port and I assumed it fixed the brute force problem. Am I right or are the ...
17
votes
7answers
3k views

Restart SSH on a machine where SSH is the only mode of access

I've made some changes to sshd_config file and therefore need to restart. I'm looking tips on safely restarting ssh when getting physical access to the server would be a huga PITA.
14
votes
4answers
3k views

Is it possible to get OpenSSH to log the public key that was used in authentication?

I have a production system where several different people are allowed to log in to a single account - the account is for the application and not for the person as we don't have personal accounts on ...
12
votes
3answers
970 views

Inline SSH command

Is it possible to do a simple inline style SSH command, for example: ssh foo@bar.com { cd foo/bar && rm *.foobar }
11
votes
14answers
22k views

Stop ssh login from printing motd from the client?

I've got SSH passwordless set up, however it prints the MoTD when it logs in. Is there anyway to stop that happening from the client side? I've tried ssh -q but that doesn't work. I don't want to use ...
8
votes
4answers
5k views

Transfer files via SSH

I want to use file transfer via SSH on some scripts. I've read it's possible to tar over ssh. Where should I start reading?
8
votes
4answers
657 views

Remote Root Login

I know one of the first things you do to secure a server is disallowing remote root login. Passwords are pretty weak; what do people think of only allowing root login via ssh keys or other ...
5
votes
1answer
645 views

Adding port forwardings programmatically on a ControlMaster SSH session

I just found out about the ControlMaster/ControlPath feature of OpenSSH, which allows you to use a single SSH connection to run multiple terminals. As I often use SSH to use port forwarding to get ...
12
votes
10answers
5k views

Best way to go about changing a root password on 3000+ Solaris, AIX, and Linux servers?

Long story short: Big old corporation, lots of UNIX/Linux servers. I inherited responsibility for a bunch of scripts that that left a few years ago. One of them was a script that would be run every ...
8
votes
4answers
5k views

How can I automatically change terminal colors when I ssh a server?

I'm frequently logging into different servers from my os x terminal window. I'd like to assign a color scheme for different hosts so that my terminal windows are easier to tell apart. Can this be ...
8
votes
1answer
2k views

SSH passphrase remembered in MacOSX Snow Leopard

I am facing a very strange situation with Snow Leopard. I have a Linux server, configured to accept an ssh connection authenticated only through RSA key. No password. On my laptop I correctly deployed ...
7
votes
2answers
7k views

SFTP fatal bad ownership or modes for chroot directory ubuntu 12.04

I just set up my SFTP server and it works fine when I use it from my first user account. I wanted to add a user which we will call 'magnarp'. At first I did like this in sshd_config: Subsystem sftp ...
7
votes
2answers
4k views

How can I close SSH tunnel gracefully?

I have open tunnel with ssh -2 -N -L 5001:localhost:1019 eonil@test.local The tunnel is working good, but I have to Ctrl+C or Ctrl+D to force quit the tunnel. How can I close the tunnel gracefully? ...
7
votes
4answers
31k views

Free public SSH server for testing purposes [closed]

I'm writing an application that makes connections to SSH servers. It doesn't need anything specific from the server (except running under GNU/Linux). I need SSH servers for running my application ...
6
votes
6answers
8k views

Can't get detached screen to resume

I use putty and have an unreliable wireless connection, so I use screen to keep my work going. Often I'll get disconnected, and then I can't reattach my screen. I'll run screen -D -RR and it will just ...
5
votes
8answers
13k views

Is it possible to prevent SCP while still allowing SSH access?

Using Solaris and Linux servers and OpenSSH, is it possible to prevent users from copying files using "scp" while still allowing shell access with "ssh"? I realize that 'ssh $server "cat file" ' type ...
4
votes
5answers
4k views

How can I disconnect ssh users, or limit the number of ssh logins?

I have an application that is using ssh to authenticate. Due to a variety of regulations (HIPAA, etc) users can only be logged in for a certain amount of time, and they can only be logged in once. I ...
4
votes
3answers
3k views

Is it possible to connect a EC2 Linux instance via ssh without the key pair?

I can connect to my EC2 Linux instance via ssh using the key pair (*.pem). Is it somehow possible to connect it with ssh with out the pem file?
4
votes
3answers
6k views

How can I enable X11 forwarding to a Debian server box?

I want to connect to a server with SSH (a Debian installation in a VMware image). On that server I want to call gitk a repository viewer for git. What do I need to do to make this work?
16
votes
4answers
16k views

Ssh, run a command on login, and then Stay Logged In?

I tried this with expect, but it didn't work: it closed the connection at the end. Can we run a script via ssh which will log into remote machines, run a command, and not disconnect? So ssh in a ...
10
votes
3answers
24k views

how do you create an ssh key for another user?

I'm trying to create an ssh key for another user. I'm logged in as root. Can I just edit the files generated by ssh-keygen and change root to the user I want?
9
votes
2answers
8k views

How to check if a RSA public / private key pair matched

I have two files, id_rsa and id_rsa.pub, what command can be used to validate if they are the valid pair.
7
votes
9answers
38k views

How can I map a SFTP to a Drive, natively in Windows

Today I saw that Vista and Win7 (which I am using) have the option to map ftp natively, according to this article: http://cybernetnews.com/cybernotes-map-a-ftp-to-a-drive-in-windows/ But I need to ...
6
votes
3answers
8k views

Allow scp/ssh for www-data user

I am on Amazon EC2 using Ubuntu 10.04.2 My web folder is owned by www-data so I want to be able to log into my server as www-data for ssh and scp. Thanks! Adding the line to my /etc/ssh/sshd_config ...
6
votes
3answers
3k views

Running 'sudo' over SSH

I'm writing a script which is to log onto a bunch of remote machines and run a command on them. I've set up keys so the user running the script does not have to type the password of each machine, but ...
5
votes
2answers
4k views

SSH tunnel over multi hops using putty

I have a situation where I want to connect to a Linux machine running VNC (lets call it VNCServer) which is behind two consecutive Linux machines i.e., to ssh into the VNCServer, I have to ssh into ...
5
votes
3answers
1k views

OpenSSH with public keys from database

Is it possible to fetch the public keys from a database instead of the authorized_keys file? I would like to use such a setup to manage ssh access to things like git repositories for multiple users ...
4
votes
2answers
1k views

Remote server hangs, gets stuck. How to debug?

I have an vps running on VmWare ESX with Ubuntu 8.04 LTS. It has been running smoothly for the past 3 months, however recently we've notices two strange bugs. a. The server hangs, today was second ...
4
votes
2answers
10k views

execute su -c over ssh

I am trying to check the BIOS version of a server over SSH, a command that requires root privileges: ssh remote-server su -c dmidecode but this of course fails with the error: standard in must ...
3
votes
3answers
3k views

How to assign a hostname to SSH tunnel

I'm using ssh root@my.server.ip -g -L 4321:localhost:28017 to establish a tunnel from my MacBook to my dedicated server at my hosting provider. It works well. Now I want to access several admin sites ...
3
votes
2answers
3k views

How to display SSH banner at login, but only for password authentication

I have a warning message that is displayed to a user after they enter their username to log in to our Linux servers. I only want to display this message for password authentications, and not when ...
3
votes
6answers
2k views

Same command on multiple servers

I'm just wondering if there is any fellow sysadmin with the need to execute one command on multiple servers. If so, what technique are you using? I have grown tired to ssh-ing to 3-5 servers and ...
2
votes
1answer
842 views

SSH from Windows to Linux with AD certificates

I have a Windows client machine connected to Active Directory and a Linux server also connected to Active Directory (through PAM w/ LDAP), and I want to be able to do password-less SSH from Windows to ...
0
votes
2answers
2k views

ssh remote command-fu

I am trying to do a remote backup from behind a firewall. It is really no problem to break this out into its own script that gets called in crontab, but that isn't any fun! What I am trying to do ...
9
votes
8answers
16k views

Why can't I ssh into my new EC2 Instance?

I created a new instance (tiny, 64 bit AMI linux from Amazon) Created a new key pair called "mir". I downloaded mir.pem and put it in my ~/.ssh folder. I even did ssh-add mir.pem. Then I tried to ...
9
votes
3answers
8k views

What options can be put into a SSH authorized_keys file?

I found this article on options that can be put before a key in the authorized_keys file. I was wondering though, are there more? Options listed in the article are from="domain" ...
8
votes
4answers
15k views

SSH X11 not working

I have a home and work computer, the home computer has a static IP address. If I ssh from my work computer to my home computer, the ssh connection works but X11 applications are not displayed. In my ...
7
votes
6answers
6k views

Routing all traffic thru socks proxy using ssh -D

is it any easy way to route all traffic through a ssh proxy with -D? I can configure individual specific applications to do this, but I would like a configuration that routes all the traffic on the ...
6
votes
1answer
2k views

Is it possible to run sshd as a normal user?

I'm aiming to start up a second sshd instance on a non-privileged port (e.g. 2222) with my own configuration file. Obviously, the sshd process can't setuid so logging in as users other than the one ...
6
votes
2answers
2k views

Authentication Order with SSH

i am still have troubles mastering sshd - when I login with -v I see that ssh is authenticating the following way debug1: Authentications that can continue: ...
6
votes
2answers
3k views

How to revoke an ssh certificate (not ssh identity file!)

I've generated an ssh certificate like this: ssh-keygen -f ca_key # generate a ssh keypair for use as a certificate generate a host key ssh-keygen -s ca_key -I cert_identifier -h host_key.pub ...
6
votes
3answers
2k views

What exactly does ssh send when performing key negotiation?

When explicitly specifying identity file to ssh: ssh -i ./id_rsa ... I have these lines in ssh debug trace: debug1: Offering public key: ./id_rsa debug3: send_pubkey_test debug2: we sent a ...
5
votes
1answer
288 views

Conditional ProxyCommand in ~/.ssh/config?

I have my ~/.ssh/config configured with various hosts that are accessible either while on our company VPN, or via a SSH proxy server. At the moment I just have Host internal-server ProxyCommand ...
5
votes
4answers
7k views

ubuntu server, ssh, write failed: broken pipe

I'm getting some bizarre behavior with Ubuntu Server 10.04 64bit on two of our new servers (both fresh installs). I have ubuntu server (same version) deployed on 4-5 other servers without this issue. ...
5
votes
4answers
4k views

Create SSH user with limited privileges to only use Git repository

I have a git repository hosted on my SunOS server, that I remotely use through ssh git clone ssh://myUser@mydomain.com/path/to/git Now I need to add more users to be able to access that repository, ...
5
votes
2answers
1k views

How can I setup OpenSSH per-user authentication methods?

I'd like to be able to have one set of users authenticating using public key auth and other users to use password authentication. Is this possible in OpenSSH on Linux? If so how do I go about it? ...