Skip to main content

New answers tagged

0 votes

SSH tunnel error for root: sys_tun_open: failed to configure tunnel (mode 1): Operation not permitted

funny i fell here, i had the same issue by trying to do port forwarding via ssh. Actually, after a moment, i just changed the directive 'GatewayPorts' to "yes" and decommented it, and that ...
Virgil Ftbn's user avatar
0 votes

How to set PATH when running a ssh command?

As per muru's answer, the only thing that worked for me was to prepend to the user's .bashrc (before the lines that check for interactivity). Here is a link with more info. As I was running sshd in a ...
IggyM's user avatar
  • 1
0 votes

Cannot connect to home server via SSH on Arch Linux

Did you check your router for any configuration like client/AP isolation? They are often set ON for wifi/cable devices, so devices from the Wifi cannot access the cable ones. Also, I would go full ...
dav1app's user avatar
  • 101
1 vote
Accepted

How to make ssh return immediately after running background job

According to the ssh man page The session terminates when the command or shell on the remote machine exits and all X11 and TCP connections have been closed. The reason ssh doesn't exit right away is ...
user10489's user avatar
  • 7,469
1 vote

How to make ssh return immediately after running background job

The behavior is the same, actually. What happens is that you are sending the sleep to the background on the remote machine, but you are not sending the ssh command to the background on your local ...
terdon's user avatar
  • 245k
3 votes
Accepted

How do I get linux flavors, like Fedora, RHEL, Amazon Linux, and others that don't update motd on login to do so?

This is usually only an issue on machines where people log on primarily remotely. So, the right place to do this is not PAM, but the login shell – exactly the profile you don't want to "fiddle&...
Marcus Müller's user avatar
1 vote

"Connection refused lost connection" error while using scp command

Can you successfully perform interactive SSH on the SCP target machine? I just had a similar situation. The problem was a change in the known key on the source for the target machine. After flushing ...
Marcus's user avatar
  • 11
0 votes

How do I get linux flavors, like Fedora, RHEL, Amazon Linux, and others that don't update motd on login to do so?

We can use PAM to execute a custom script on login: Ensure update-motd is installed via your package manager. Edit the PAM config for SSH /etc/pam.d/sshd: ... session required pam_selinux.so ...
four43's user avatar
  • 111
0 votes

Persisting sshd_config settings

There is now, at least in Debian based distributions. If having trouble, see: https://serverfault.com/questions/1055470/sshd-doesnt-read-included-config-files-at-startup
Andrew's user avatar
  • 1
0 votes

"Command not found" when using ssh and non absolute commands

If you source your current profile settings. E.g. .bashrc or .zshrc, you'll have access to the same $PATH as you do when you login to the server the normal way. I.e. ssh user@server -t 'source ~/....
Pylinux's user avatar
  • 101
-1 votes
Accepted

git clone error: bad line length character

As pointed out in @marcus-müller's answer, apps like git can't handle MOTDs & other sourced messages. Therefore: Remove any messages from remote shell output e.g. MOTDs configured in bashrc or ...
tsilvs's user avatar
  • 99
1 vote

git clone error: bad line length character

The usual reason something like this happens (I've seen this with git, but also with emacs' TRAMP remote access protocol) is that the shell of the authenticating user sends some unexpected bytes, ...
Marcus Müller's user avatar
1 vote

How do I get lastlog timestamps in a generic format?

At least in Ubuntu, the lastlog command appears to respect locale and timezone settings. So instead of trying to parse and convert arbitrary timestamp formats, you could consider setting the lastlog ...
steeldriver's user avatar
  • 81.9k
1 vote

Mosh with port forwarding (like SSH)

You can also setup autossh which will reconnect when tunnel stops working
Konrad Kuźnicki's user avatar
1 vote

Enable/Disable OpenSSH daemon on an interface

Adding to u1686_grawity answer... Now in Ubuntu 24.04 LTS, it appears sshd-socket-generator checks in the sshd configuration (sshd_config and /etc/ssh/sshd_config.d/ ) for Port and listenaddress ...
xiaoju's user avatar
  • 111
0 votes

Answer yes in a bash script

A safer and better way to do is add Host * StrictHostKeyChecking accept-new to ~/.ssh/config file. The newer option accept-new in open-ssh client will accept new keys but will reject if the ...
Shivam Anand's user avatar
2 votes

X11 DISPLAY Configuration for SSH and Nvidia Optimus Graphics

Nvidia Optimus is part ACPI (to provide a way to command GPU to power off), part hardware (to facilitate switching the GPU power on/off while the system is running) and part display drivers (to deal ...
telcoM's user avatar
  • 101k
0 votes
Accepted

Saving ZSH history across SSH sessions

To save history between sessions, you primarily need to set a few variables for history size in your ~/.zshrc. For example. HISTSIZE=10000 HISTFILE=~/.zshistory SAVEHIST=8000 Avoid using export with ...
okapi's user avatar
  • 757
0 votes

SSH shows double shell prompt after entering a command

It seems that terminals on Windows don't understand control sequences when TERM is set to xterm*. Try : export TERM=cygwin Another option is to install Git-bash(https://www.git-scm.com/downloads) and ...
Philippe's user avatar
  • 1,475

Top 50 recent answers are included