Questions tagged [ssh]

SSH, or "Secure Shell", is a networking protocol for securely connecting to a remote computer over an unsecure network. SSH is also the name of the default command-line SSH client. This tag is for questions involving using and troubleshooting SSH connections, as well as setting up and configuring SSH for applications which use the SSH protocol. This tag should be used with other tags to better identify the environment of the problem.

Filter by
Sorted by
Tagged with
311 votes
10 answers
453k views

How can I set up password-less SSH login?

I want to be able to login to a remote via ssh without having to enter the password all the time. How do I set it up? Is a different command required to execute a password-less session?
Oxwivi's user avatar
  • 17.8k
998 votes
14 answers
1.3m views

How to keep processes running after ending ssh session?

Let's say I launch a bunch of processes from a ssh session. Is it possible to terminate the ssh session while keeping those processes running on the remote machine?
Olivier Lalonde's user avatar
57 votes
4 answers
355k views

What is the simplest way to have remote GUI access to Ubuntu 16.04 “server” from Ubuntu 16.04 “desktop”?

I'm trying to figure out what is "lightweight" way to configure my Ubuntu 16.04 LTS server to have access via GUI (over SSH as option). I would like to reach it from my Ubuntu 16.04 workstation. I ...
4xy's user avatar
  • 1,145
134 votes
13 answers
156k views

How to harden an SSH server?

What measures can/should I take to make sure that security around my SSH server is absolutely impermeable? This will be community wiki from the start, so lets see what people do to secure their ...
146 votes
5 answers
331k views

How can I chroot sftp-only SSH users into their homes?

I want to give a client access to my server, but I want to limit those users to their home directories. I will bind-mount in any files I want them to be able to see. I've created a user called bob ...
Oli's user avatar
  • 293k
42 votes
4 answers
78k views

Simple & easy way to jail users

I need a simple and easy way to jail users in their home directories in Oneiric. Do you have a simple configuration for jailing users, with full help, or some good web links? I would be offering an ...
One Zero's user avatar
  • 27.1k
51 votes
6 answers
113k views

Ubuntu 22.04 SSH the RSA key isn't working since upgrading from 20.04

Up until last week I was running Ubuntu 20.04 happily, and then over the weekend decided to back everything up and install 22.04. I've had a couple of teething issues which I've solver, however I'm ...
Colin's user avatar
  • 1,048
32 votes
6 answers
68k views

SSH Server stops working after reboot, caused by missing /var/run/sshd

My VPS wasn't rebooted for about 3 months. It is hosted on a server with OpenVZ virtualization type and the operating system is Ubuntu 16.04. For some reason, I rebooted the VPS and after that, I ...
pa4080's user avatar
  • 29.8k
25 votes
2 answers
65k views

Remote login with graphical display manager (GDM, LightDM)

Is it possible to remotely (via ssh) make a login to GDM? I'll explain a situation in which I'd need this: I'm on my laptop and connect to my desktop via ssh. I realize there are some updates ...
luri's user avatar
  • 4,102
286 votes
22 answers
1.9m views

SSH Permission denied (publickey)

I am trying to connect to a Linode (running Ubuntu 12.04 LTS) from my local machine (also running Ubuntu 12.04 LTS) I have created a private and public key on my local machine and copied my public ...
Pattle's user avatar
  • 2,999
150 votes
5 answers
428k views

How to start a GUI software on a remote Linux PC via SSH

Sometimes I need to start XMBC media player or other GUI software on one of my remote PC (small Xubuntu PC used as a media center). Usually, I do this by starting an X11vnc server on the remote PC via ...
Raben's user avatar
  • 1,603
145 votes
5 answers
965k views

How to enable ssh root access on Ubuntu 14.04

I´d like to enable the ssh root access on Ubuntu 14.04. Editing the /etc/ssh_config (PermitRootLogin yes) didn't affect anything.
user283163's user avatar
  • 1,459
33 votes
4 answers
18k views

How does using the tilde work as a shortcut to my home directory?

I was confused, trying to copy some files from one PC to another. I have it figured out, but the syntax is still confusing to me. This works: scp ~/Desktop/Volenteer.png [email protected]:~j0h/b which ...
j0h's user avatar
  • 14.8k
14 votes
1 answer
13k views

Filezilla or WinSCP alternative for Ubuntu

On Windows I'm using FileZilla to upload/download files on my WordPress website, via sftp, while using ssh key. Now Linux is my primary operating system. For the last month FileZilla client was ...
ShahMoeen's user avatar
  • 145
238 votes
4 answers
441k views

How do I configure a new Ubuntu installation to accept ssh connections?

I just installed Ubuntu. How do I set it up to allow me to ssh into it? Right now I get "ssh: connect to host x.x.x.x port 22: Operation timed out".
Daryl Spitzer's user avatar
158 votes
8 answers
158k views

How do I SSH to machine A via B in one command?

I want to access a computer, say machine A which is based in my university's network. However, this computer is only accessible via the internal network of the university, so I can not use SSH to this ...
nikosdi's user avatar
  • 1,762
9 votes
2 answers
6k views

SSH is allowing remote connections only after a local login to the server

I have installed Ubuntu Server 16.04 32-bit on my old notebook wirelly connected to internet (external IP). Since the beginning I've added ufw and Fail2ban. But then I discovered after a reboot I ...
noliva's user avatar
  • 93
465 votes
8 answers
944k views

Easiest way to copy ssh keys to another machine?

I am lazy at home and use password authentication for my home machines. I am ready to move to key based authentication. There are many options on the web on how to do this, including catting then ...
Jorge Castro's user avatar
  • 71.7k
24 votes
2 answers
65k views

Key based SSH login that requires both key AND password

My problem is : I developed successfully RSA Key based ssh login on board from system. When a client logs in for the first time, ask about private key and passphrase also which works fine. In second ...
Tejas Virpariya's user avatar
3 votes
1 answer
27k views

Permission denied when trying to run a script that uses 'sshpass'

The idea is to make this script run without needing to type any passwords of the hosts (written down in the Hosts.txt file). Right now, when I'm running this, I get a Permission denied, please try ...
Ludvig's user avatar
  • 165
3 votes
1 answer
4k views

Connect via ssh to one of the multiple clients on same network

let's imagine i am at school with an android phone. I have a computer at home and that computer has a virtual machine working on it. here is the scenario, client and virtual client has ssh-client and ...
Ozan Temel's user avatar
146 votes
3 answers
171k views

How to create a restricted SSH user for port forwarding?

ændrük suggested a reverse connection for getting an easy SSH connection with someone else (for remote help). For that to work, an additional user is needed to accept the connection. This user needs ...
Lekensteyn's user avatar
  • 174k
140 votes
3 answers
278k views

How do I keep track of failed SSH log-in attempts?

I'd like to see if somebody has been trying to log-in by brute-force into my Ubuntu 12.04 server over SSH. How can I see if such activities have been taking place?
Ivan's user avatar
  • 57k
16 votes
6 answers
39k views

How can I access my Ubuntu phone over ssh?

Whenever I try to run apt-get install openssh-server I get the following errors: root@ubuntu-phablet:/home/hablet# apt-get install openssh-server W: Not using locking for read only lock file /var/lib/...
user195123's user avatar
5 votes
1 answer
5k views

Access remote multiple servers behind NAT

I have a situation where our Ubuntu servers were deployed across multiple remote locations. These servers were behind a carrier grade NAT and also an internal NAT. Now from a central location I want ...
Sagar Khatiwada's user avatar
1 vote
3 answers
3k views

Secure an Ubuntu OpenSSH server from Brute force attacks but without a firewall or SSH key pair? [duplicate]

I use Ubuntu 16.04 and seek to harden my SSH authentication in a special manner. The current situation: I have a machine with a minimal Ubuntu server I use mainly to transfer files to via its local ...
user avatar
55 votes
4 answers
283k views

How to set up passwordless SSH access for root user [duplicate]

I need to configure a machine so software installation can be automated remotely via SSH. Following the wiki, I was able to setup SSH keys so my user can access the machine without a password, but I ...
Cerin's user avatar
  • 6,455
43 votes
5 answers
120k views

How can I install Ubuntu on a device without a screen nor a keyboard?

This is tricky. I would like to install Ubuntu on a machine that is intended to work as server, and for some reason I do not have an option to connect a screen to it. I expect this may be similar to ...
Rafał Cieślak's user avatar
43 votes
6 answers
330k views

permission denied for root@localhost for ssh connection

I just installed Ubuntu 14.04 and LAMP on that. Then, I wanted to configure my server, so tried out This tutorial. When I give the command: ssh root@localhost I get : Permission denied, please try ...
vnay92's user avatar
  • 533
22 votes
10 answers
22k views

Long wait time on login

When I log in on my server I get this: No mail. Last login: Fri Nov 5 14:22:45 2010... then I must wait for 5 sec and then is ready... wolfy@ubuntu-server:~$ Is this wait time normal or should I ...
Wolfy's user avatar
  • 7,910
4 votes
2 answers
6k views

While loop only processes the first entry of ssh command

So I don't know much about bash and need some pro help. I am trying to run a script like this one: filename='file1' while read p; do ssh -p 2222 $p 'who -b' | awk '{print $(NF-1)" "$NF}' >> ...
Ludvig's user avatar
  • 165
2 votes
1 answer
2k views

Best place to automatically add mode in xrandr

What is the best place to add a mode with xrandr? As of now, I added xrandr --newmode "1344x744_60.00" 80.75 1344 1408 1544 1744 744 747 757 773 -hsync +vsync xrandr --newmode "...
sancho.s ReinstateMonicaCellio's user avatar
300 votes
9 answers
1.3m views

How do I add SSH Keys to authorized_keys file?

I have an Ubuntu server on Amazon EC2, that I use for development, and today I stupidly cleared everything out of my ~/.ssh/authorized_keys file. Luckily I have an SSH open, so I am still connected, ...
Dave Long's user avatar
  • 3,386
44 votes
6 answers
44k views

How to use SSH (ssh & rsync commands)?

How can I SSH with a remote server so I can browse files and edit them? I have a username and password to use.
el_pup_le's user avatar
  • 963
14 votes
4 answers
17k views

How do I run a graphical application on a remote server when logged in through SSH?

I am trying to run gedit from an SSH terminal on Windows, connected to an Amazon EC2 instance running Ubuntu 12.04 Server and I am getting this error: Cannot open display: How do I fix it?
Gaurav Agarwal's user avatar
366 votes
10 answers
857k views

How to prevent "Write Failed: broken pipe" on SSH connection?

What can I do to configure SSH on both client and servers to prevent Write Failed: broken pipe errors? It often occurs if you sleep your client computer and resume later.
sorin's user avatar
  • 9,868
143 votes
14 answers
1.3m views

How to solve 'Connection refused' errors in SSH connection?

I have an Ubuntu Server 10.10 32-bit in my home. I'm making SSH connections to it from my PC via Putty. The problem is, sometimes I'm able to login seamlessly. However, sometimes it gives me an error ...
frbry's user avatar
  • 1,531
108 votes
7 answers
212k views

Mount remote directory using SSH

How to mount a remote directory using SSH to be available same as if it is a local directory?
Maythux's user avatar
  • 84.2k
102 votes
7 answers
104k views

Locale variables have no effect in remote shell (perl: warning: Setting locale failed.)

I have a fresh ubuntu 12.04 installation. When i connect to my remote server i got errors like this: ~$ ssh example.com sudo aptitude upgrade ... Traceback (most recent call last): File "/usr/bin/...
Janning's user avatar
  • 1,885
59 votes
3 answers
54k views

Host alias for ssh

There are a few SSH destinations I will frequently be connecting to and I'm wondering if rather than remember the IP address I can create a host alias for them. I'd like to be able to use... ssh -p ...
Ben's user avatar
  • 1,016
51 votes
5 answers
275k views

Using scp to copy files from remote to home machine

This is probably a simple error, but I can't work it out. My computer hostname is Felix (hostname -f returns Felix) I am trying to move a file from my university account to my home computer using scp. ...
Loz's user avatar
  • 613
50 votes
3 answers
215k views

Can't SSH in as root

I'm using the default installation of openssh-server for my Ubuntu 14.04 server. I can connect through the console as root like normal, with my username and password. When I try to SSH with the same ...
vaindil's user avatar
  • 928
3 votes
1 answer
28k views

Keep running a python program even after logging-off the ssh session [duplicate]

I python script called scrape.py. As the name suggests it is a web crawler and I want it to run continuously on my Linux machine even after I log out and end the ssh session. I read a lot around here ...
Krishnang Dalal's user avatar
181 votes
11 answers
248k views

Enter SSH passphrase once

Before upgrade When I was running git clone git@... (using ssh) once per computer restart a window dialog appeared containing a textbox for inserting my SSH passphrase and confirmed with OK. Then the ...
Ionică Bizău's user avatar
69 votes
7 answers
234k views

How do I launch a remote firefox window via SSH?

When I SSH to a remote box $ ssh -X remotebox then start firefox on the remote box remotebox$ firefox and I have firefox running on my local machine, a local firefox window will open. no firefox ...
Lesmana's user avatar
  • 18.4k
37 votes
2 answers
19k views

Disable password access through SSH?

I'm setting up a server for backing up my desktop box remotely. I want to prevent remote password access to the server, permitting only users with private keys (AKA my desktop box) to access it. How ...
Evan Kroske's user avatar
  • 2,038
25 votes
2 answers
42k views

What does "pts/" in the output of w mean?

When I run w - to see who is logged on and what they are doing, i see this: USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT user tty7 :0 08:14 10:32m 44:...
Achu's user avatar
  • 21.2k
23 votes
9 answers
45k views

ssh no longer allows public key authentication

My machine recently stopped accepting incoming public key authentication. I have an ubuntu 11.04 desktop that I ssh into from a windows machine. I use putty with pageant. I am able to connect but ...
Andrew Redd's user avatar
  • 2,157
21 votes
6 answers
25k views

SSH default port not changing (Ubuntu 22.10)

I am on Ubuntu 22.10 and I cannot change SSH default port. I have tried the following: Edited /etc/ssh/sshd_config, left the default #Port 22 line but added Port 1234 below it. Then added allow rule ...
Silently's user avatar
  • 603
16 votes
5 answers
29k views

SSH without password does not work after upgrading from 18.04 to 22.04

SSH without password does not work after upgrading from Ubuntu 18.04 to Ubuntu 22.04. The client is Ubuntu 22.04 and the server is Ubuntu 14.04. Using Ubuntu 18.04 as client works correctly. I have ...
Mario's user avatar
  • 959

1
2 3 4 5
13