[SOLVED] Can't login to the server from second terminal
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have created an OpenBSD Secure Shell server on Ubuntu. I can access it from my laptop as root via ssh. But when I open a second terminal, I can't login.
Remote access to the root account is not ideal. Most distros block it by default. Can you connect to the Ubuntu server using a normal user account, and then use sudo to work?
Can you show what you are typing when you try in a second terminal and it fails? Bonus if you can increase the verbosity of the SSH client with -v, -v -v, or -v -v -v.
ssh -v -i ~/.ssh/xxx.pem user@xx.xx.xx.xx
OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /home/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22.
debug1: connect to address xx.xx.xx.xx port 22: Connection timed out
It seems that somewhere there is a limit on the number of open sessions per user.
Thanks. The server configuration looks quite normal.
I'm not sure where to look next. When you have one SSH connection active, any additional ones always fail? Can you try seeing the initial identification string from the server? For that, instead of making your second connection with the SSH client, use Netcat instead:
Code:
nc 203.0.113.101 22
Obviously substitute the right address for your SSH server. It should output something like this:
This helped me.
In ~/.ssh/config
post *
# Connection Multiplexing
ControlMaster auto
ControlPersist 600
ControlPath ~/.ssh/ctrl/%C
That runs multiple SSH sessions over a single TCP connection. So, if TCP multiplexing helped, then the problem is at a layer or two lower than the application layer. So look at TCP or IP rather than SSH. That would mean maybe the packet filter or the router.
Last edited by Turbocapitalist; 04-29-2023 at 08:39 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.