I connected to the server using ssh details such as username and password. Is it okay once I done this and now I will use scp to copy my folder contents to the server? I googled, but the solution is like creating ssh connection by key/pair and then can do scp.
So you want to copy a directory to a remote server using scp. You don't have to first log into the server to do that. It should be enough with scp -r folderpath username@server:remotepath (where remotepath is where you want to put the directory) from the local machine.
Ah, you don't want to give a password? In that case you will have to set up key-based authentication with the server. This involves creating a public and private SSH key with ssh-keygen locally and copying the public key to ~/.ssh/authorized_keys on the server. I'll see if I can find a good question/answer on the site for you to read.
I afraid I can do that because already there is ssh key generated but for different server. Here, is it possible to set up another ssh key/pair without effecting the other one?
If you already have a key, there is nothing stopping you (apart from if you have some sort of local rules about it) from using the same key pair for this server that we are interested in now.
For example, I have a single keypair on my main machine. I have copied the public key to all other machines that I need to log in to from this machine.
@astrosixer But do you have a password to log into it?
So what if I would like to use different private/public key pair for each of the remote servers am connecting to via ssh? Is it possible to do so? Means can I store multiple ssh private keys in my local system that each key represents different servers?
@astrosixer yes, it’s possible, but it gets very annoying very quickly IME
The security model really is that one private key identifies one account on one client machine, and is used as-is with all remote systems you want that account to connect to.
@astrosixer As Stephen said. Having to keep track of multiple keys is annoying, and in the long run could also be a security issue (once you start forgetting what keys have been copied to where).
@astrosixer Yes, I see no reason why you should not be able to (assuming you have permissions to edit the files you want to edit, as ordinarily is the case).
@astrosixer It is not more or less safe to use nano over SSH than it is to use it locally, unless you have reasons to believe that the admins of the remote system are malicious in some way (in which case you shold probably not be on that system at all).
Thanks to both of you guys @Kusalananda and @StephenKitt You guys gave me a pretty much insight. It was very much helpful to me as I was doing for the first time.
It might be useful to allow comments in zsh commands written on the command line, as
in bash, but
% echo test # test
zsh: bad pattern: #
Any way to get the same behaviour as in the bash shell?
I'm surprised you couldn't create the tag. But I'd guess there is no expert on comments (it's too generic in addition to being too specific...), or anyone who'd want to follow the tag. It could be useful in searching, I guess, e.g., for [zsh] [comments], but...
I watch all the tags I have silver badges for, then I have two custom searches, one for my gold badge tags, and one for the siver badge tags (minus the gold ones). The searches are for unanswered questions.
Like fi for if and done for for, esac is the required way to end a case statement.
esac is case spelled backward, rather like fi is if spelled backward. I don't know why the token ending a for block is not rof.
@Kusalananda I wonder if you say that based on not seeing a record in the question's timeline? That particular record was only added to recently-asked questions
BTW — I'm experimenting with a program to wipe disks. Trying to do a single-pass with pseudo-random data, then ideally would like to verify it. Or at least be able to.
First attempt, use dmcrypt to use AES/XTS, then just write 0s to it. Disk will see psuedo-random data due to encryption.
Problem: turns out directly writing a random steam is ≈25% faster. Mainly it seems due to using O_DIRECT with 1MB blocks; upping the block size to 512MB(!) gets all the speed back (and probably dropping O_DIRECT, but that'd have other issues, like not really being sure which block failed to write)
So I'd like to get a fast pseudo-random stream in my program (currently Perl)... Seems like a stream cipher like ChaCha20 or AES-CTR would provide the needed bytes, and Perl has OpenSSL modules...
But... taking a look at the OpenSSL docs... I understand why everyone rolls their own crypto.
Yay! Someone who got their non-answer deleted because it was a question came back and actually asked the question properly! unix.stackexchange.com/questions/557562