New answers tagged

0 votes

How can root get access to SSH_TTY

From the file session.c, we can see that the do_setup_env function, which sets SSH_TTY inside of the SSH server, is called after the session is already set up, so there is no way for Ubuntu's¹ update-...
Vilinkameni's user avatar
0 votes

Unable to access proftpd server via sftp: port 22

This has been sorted. The resolution is sftp module (mod_sftp.c) is not enabled by default. The modules can be found in /etc/proftpd/modules.conf, uncomment the mod_sftp section So I installed the ...
user16605410's user avatar
0 votes

Why is ssh-agent.service running, but when I use ssh-add I get an error connecting to the agent?

I googled how to fix it, and found a solution eval $(ssh-agent -s), but it only works for bash, and I'm using fish That does not apply here; that's the command to start a new instance of ssh-agent (...
u1686_grawity's user avatar
0 votes

Why is ssh-agent.service running, but when I use ssh-add I get an error connecting to the agent?

You basically have two options: Use the -c flag: eval (ssh-agent -c) Use keychain instead Source
ramius's user avatar
  • 833
2 votes
Accepted

What's the simplest way to convert between SSHFP hex and ssh-keygen SHA256 Base64?

To convert from base64 to hex, you can use perl for instance: $ ssh-keygen -lf gnome.pub | perl -MMIME::Base64 -lpe 's{SHA256:\K\S+}{unpack("H*", decode_base64($&))}e' 256 SHA256:...
Stéphane Chazelas's user avatar
3 votes
Accepted

After changing the username, no SFTP login is possible anymore

After checking sshd_config for fifth time, I found the group rule that is preventing the login. Match Group ftp ChrootDirectory /opt/ftp/%u ForceCommand internal-sftp -u 0002 ...
spaceman117X's user avatar
0 votes

How can I run ssh-add automatically, without a password prompt?

Answer for myself in future: on Fedora just do nothing! Simplly try to pull git repository with this key. Nice gui will popup and ask you whether to store it in keyring. Now you can use this key ...
leanid.chaika's user avatar
0 votes

What is a better way to deal with server disconnects of sshfs mounts?

All of my sshfs mounts are at ~/mnt. I therefore put this in my crontab: */10 * * * * ls ~/mnt/* > /dev/null 2>&1 This runs every ten minutes. It runs ls on my mount directories. The output ...
jbrock's user avatar
  • 1,141
0 votes

What is default value of ServerAliveInterval?

In addition to the accepted answer, note that setting ServerAliveInterval to one trillion as in your question may cause an error "invalid time value" on 32-bit OpenSSH clients. While I don't ...
Joachim Wagner's user avatar
0 votes
Accepted

Windows X2Go using ssh config file

A workaround is to use an SSH tunnel. I got the inspiration for this from here. First, one needs to set up the ssh config file as desired. Here, I use the cipher option and a proxy: Host remote* ...
Simon T.'s user avatar
0 votes

'connection unexpectedly closed' while using rsync with various command line arguments

in my case such command rsync -vaP -e "ssh -i ~/.ssh/id_rsa_test" ~/source/grafana-test-logs [email protected]:/mnt/test/logs works after /mnt/test/logs has a proper permission, so I needed ...
shock_in_sneakers's user avatar
1 vote
Accepted

How to specify a number of copies in print lpr command using ssh

The hash most likely needs to be escaped, therefore the correct command should be: cat path/to/document.pdf | ssh [email protected] lpr -\\#5
Bib's user avatar
  • 2,360
1 vote

How to display text for non-interactive login shell

~/.bashrc and the equivalent system-wide one if any (generally /etc/bash.bashrc) is normally not read by non-interactive invocations of bash. It is also not read by interactive login shell invocations,...
Stéphane Chazelas's user avatar
13 votes
Accepted

If I don't log in the desktop environments, does the desktop enviroment still cost RAM?

If there is no GUI session used, but the system still displays a GUI for login, only this GUI login part will use memory. Processes managing this are mostly waiting and thus mostly doing nothing. If ...
A.B's user avatar
  • 35.5k
1 vote

How to access git repository whilst using brew command?

That repo is not publicly acessible. If you have private access when you're logged in: Please read the link provided in the error message, it does explain what there is to do (namely, log in, get an ...
Marcus Müller's user avatar
0 votes
Accepted

SSHing to a CentOS server switches to a different user

This is being caused by several users including these having the same UID defined in /etc/passwd. (These are all members of the same group.) When logging in as workspaceuser the UID is set to 10000 ...
Sherri's user avatar
  • 101
-1 votes

locked out of my server Permission denied (publickey)

I used the Provider's Management console to log in to the server system. I had created a backup of ~/.ssh/authorized_keys before making any change to the file which then i replaced with the original ...
Huzaifa Malik's user avatar
1 vote

How to disable ChaCha20-Poly1305 encryption to stop the terrapin ssh attack

I'm using an embedded Linux device and it looks a bit different. On the device it reports having [email protected] compiled into the binary: # ssh -Q cipher 3des-cbc aes128-cbc aes192-cbc ...
parsley72's user avatar
  • 289
0 votes
Accepted

BASH SCRIPT: Echo to file is transfered to remote host

While reviewing the question I realized it's because I CD in the backup directory path, that's where the log gets created and becomes the latest file to transfer. This is now solved
Frangu Mădălin's user avatar
3 votes

locked out of my server Permission denied (publickey)

/root/.ssh/authorized_keys and added ----BEGIN RSA PRIVATE KEY----- autorized_keys is very clearly for the public key fingerprints that should have access. You added your private key, and that doesn'...
Marcus Müller's user avatar
2 votes

ssh is not aware of client hostname?

To answer the questions asked, even though they turned out to not be the OP's actual problem, in case searchers are looking for that actual question: sshd tries to determine the client's hostname if ...
dave_thompson_085's user avatar
0 votes

Unable to SSH into remote machine but able to ping - VPNC

After debugging a little bit with ssh -v ..., I had this error: expecting SSH2_MSG_KEX_ECDH_REPLY To fix that (other link), In /etc/ssh/ssh_config edit the next line: # MACs hmac-md5,hmac-sha1,...
Francesco Taioli's user avatar
0 votes

SSH broken pipe, message authentication code incorrect

https://github.com/PowerShell/Win32-OpenSSH/issues/2078#issuecomment-1928004585 .. latest occurrence try: ~/.ssh/config host * kexalgorithms [email protected],curve25519-sha256,...
sjas's user avatar
  • 545
1 vote
Accepted

ssh tunnel and change IP

It's not about the SSH server but about the SOCKS5 client: Firefox. When Firefox performs the DNS lookup, any DNS server (such as Google's) able to do Geolocalization through DNS will issue a DNS ...
A.B's user avatar
  • 35.5k
1 vote

Is there a large performance difference between find and find2perl

To answer the question "Is there a performance difference between find and find2perl?" yes :-) The last time I remember testing this ( when find2perl was faster ) as back on Sun Microsystems ...
David Dyck's user avatar
5 votes
Accepted

Is there a way to enforce 2FA for all users on the SSH server on the Unix PAM Subsystem?

I don't have access to the unnamed UNIX system such as yours, so you are going to have to adapt the solution I'm describing here for your own situation.  (Feel free to edit this answer to add your ...
Chris Davies's user avatar
-2 votes

SSH login tries to execute commands that does not exist

Yes, it is attempting to execute /etc/passwd or a copy thereof. Really, the first course of action is to fsck your disks and revert to your pre-upgrade backup: This should be the most reliable path ...
symcbean's user avatar
  • 5,462
0 votes

Is it possible to redirect squid traffic from Host A through Host B(Squid)?

Hi I think it can help you: In host A write this: ssh -p 3567 -f -N -L *:4445:localhost:3567 <username>@<server B> in this code all traffic in port 4445 in server A forward to server B ...
ali's user avatar
  • 1
1 vote

How to migrate my encrypted passwords to my new laptop

So I eventually figured the problem myself (I think). On my new computer there was already a .gnupg directory with one default file. I don't remember which one but anyway. When I copied my .gnupg ...
JRR's user avatar
  • 121
2 votes
Accepted

Adding an account via SSH not working with openssl

Your command has a different output every time you run it. I use this command from this answer to demonstrate the problem: openssl passwd -6 -salt xyz password The variables starting with $ in the ...
ctx's user avatar
  • 2,487
0 votes

Add key to authorized_users without needing to restart sshd

In my case I needed to add the key to ssh agent: ssh-add ~/.ssh/id_rsa
Dorian's user avatar
  • 99
2 votes

Is there an env var 'SSH_PWD', and how do I use it to restore my last 'pwd' prior to logout?

Assuming your login shell is bash on these systems, you can accomplish this completely on the remote side without needing to edit any system configuration. Edit ~/.bash_logout (creating it if doesn't ...
muru's user avatar
  • 72.3k

Top 50 recent answers are included