Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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 run this command as root from machine1 (CentOS6) :
Code:
[root@machine1] : su - user1 -c "ssh -v user2@machine2"
An OpenSSH window opens, I type the password in it, and log in machine2 as user2.
Just before the window pops up the verbose mode of ssh says :
Code:
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: permanently_drop_suid: 31078
(31078 being user1's UID)
I tried the same on an machine equivalent to machine1 but in CentOS8 :
Code:
[root@machine1bis] : su - user1 -c "ssh -v user2@machine2"
No pop-up window appears, I can't type any password and can't log in machine2.
I get :
Code:
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
I don't know how to get this works on machine1bis, as on machine1.
Interactive SSH requires allocation of a TTY on the client side. Since su does not do that, you cannot use it with programs which require a controlling TTY. In short, you can't get there from here.
Instead, you can use sudo if it is properly configured.
The 2nd of the 2 commands works fine, thank you, I understand where the problem was now.
To answer to scasey the actual command in the script is 'ssh-copy-id', in order to have a connection from user1@machine1 to user2@machine2 without password.
I tested with 'ssh' to have the verbose output.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.