Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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 am getting an error like this:
"permission denied, please try again
permission denied, please try again
permission denied (gssapi-keyex, gssapi-with-mic,password)"
the scenario is:
I logged into my config server X and from there I am running the script to login to several servers where they are missing some packages which I will scp from Server Z. The scp command is giving me this error.
Code:
ssh $1 '
cd /rpm;
scp john@serverY1:/opt/rpm/src/package.rpm;
exit;
'
wondering why its getting permission denied as I am giving the right credentials.
probably you give correct user/pass for ssh, but scp has no right to go further (to server Z).
I think you can copy it to your current server and scp from here to the targets.
I login to config server as normal user but from there when I do sudo ssh to any of those serverY1/2/3, I become root over there.
So now after logging in as root when I try to grab file from serverZ its trying as my username and not root, I believe as I said that in the script to use my username and not root.
scp works with two users. One the client (local) and the other is on the server (remote) side.
The authentication needs both of them. So your local user is able to scp to john@server, but root is not allowed to scp to john@server (at least as I understood)
if I do the whole steps manually like:
john@serverX]$ sudo ssh serverY1
after giving my password, i login as root in there
root@serverY1]# scp john@serverZ:/opt/rpm/src/package.rpm .;
it works and I have access to that location as John to grab the rpm file.
is it for any reason trying to grab it as root instead of John??
the same thing, I wrote via script but its says permission denied
It seems like the first 2 failure is happening due to gssapi-keyex and gssapi-with-mic
and then it asks for my password and after I give it .. success. so this is the manual process.
but when run in a script its failing the first two times and then its not asking me for my password and directly giving the last denied message "permission denied (gssapi-keyex, gssapi-with-mic,password)"
typo
serverZ has the rpm repository.
ServerX is my config server from where I login to other servers like ServerY1/2/3 as root and ServerY1/2/3 are the servers I want to pull the rpm's from ServerZ.
so this is the error that I am getting when running from script:
Code:
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No credentials cache found
debug1: Unspecified GSS failure. Minor code may provide more information
No credentials cache found
debug1: Unspecified GSS failure. Minor code may provide more information
No credentials cache found
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: 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: 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: gssapi-keyex,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (gssapi-keyex,gssapi-with-mic,password).
the red text is the place it asked me for password when I ran it manually but when ran it in script its failing to provide me a terminal to provide input, I guess so failing, most probably.
Any workaround for this, if I am getting this right.
Might help if you posted the entire script. I don't full understand why you see the errors at the moment but when you run the script ssh actually starts another shell so the other commands i.e. scp will not run in that ssh session.
Although I don't think I have ever tried scp as a ssh command it might work with a little tweaking.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.