GPG: How Does A Gpg2Masterkey(THE Private Key) Store All The Info Of Its PubSub Keys?

For one user I generated a gpg2 key-pair. I exported these to ascii-armour text files as master.asc and pub.asc. Then took only the pub.asc onto the keyring of a second user on the same partition. I "signed" a simple text file (say trial.txt) with the master key and also transferred it to the home directory of the second user. The pub key on the second user's keyring could verify the signature on the signed text file (trial.txt.gpg) but could not decrypt it. Also, a file encrypted by the second user with the pubkey could be decrypted by the masterkey. Each key therefore has, embedded in its structure, information about child/parent keys. Can anyone thrown light on the actual method of incorporation of this mutual recognition in the key structures? Note:The same kind of recognition happens with sub-keys derived from the Master-key. Can't find any literature which details. Help pl.


Similar Content



Help Modifying Text With User Input

Hello,

I apologize in advance for my limited UNIX scripting knowledge. I am new to it and really want to learn.

I am trying to write a bash script that updates a config file based on user input.

What is the best method for accomplishing this? I need it to prompt the user for two variables, find the location in the config file, and insert new text with the two variables.

I was thinking I could use sed to find the text in the config file where the new text must be inserted before and replace it with the new text, two variables, and same ending text as before. Example:

echo "1st variable?"
read variable1

echo "2nd variable?"
read variable2

sed -e "s|<the spot in the config file that needs new config>|sometext...$variable2_somemoretext...$variable1\n<the spot in the config file that needs new config>|g" config > config2


This works except variable2 is not inserted into the replace string, only variable1 is. This is the result in config2:

sometext..._somemoretext...$variable1
<the spot in the config file that needs new config>


If anyone can tell me why variable2 isn't working in the sed replace string, or if there's a much better way for accomplishing what I'm after, I'd appreciate any help I can get.

Having Issues With Making Use Of Linux On Vmware.

Hi, I downloaded an ISO linux file for my Vmware it was with a read me file that show the login details into the OS. Now have finished the installation of the ISO on my Vmware but the problem I have is it not accepting the login details that came with the ISO I download.
this was the login that came with the ISO:

standard user:
username: user
password: password

administrative user:
username: root
password: password
It not accepting any of it I want to know if I did something wrong or there is master login deatils I can use to get to the desktop.
Am a real newbie this is my first time of dealing with Linux your answers will be appreciated a lot. Thanks.

How To Escape A FS In A CSV Text And Help With Formatting

Hi Linux Experts,

I have the following problem to solve:

-Below is the CSV file give

firstname,lastname,password,username,notes,city,phonenumber
fred,smith, notgood1, fredsmith, this user\, is the first in this file, Brighton,345698
Peter, Bloggs, anotherbad,peterbloggs,,London,987123
Jo, cooper, notmuch, jcooper, this user is Jo, Brighton, 456987
john, carter,nearlyempty,jcarter,This note is actually very long\, but really doesn't say anything very useful,,345777
sam,jones,passing, samjones, Not much of a note really, Manchester, 135790

- capitalise the first letter of the two name fields
- sanitise the formatting
- move the username column to the beginning of each line
- the phone number is missing the area code - look up the city in the following table, and add it to the beginning of the phone number column:

City, Area Code
London, 5
Brighton, 6
Manchester, 7

Provide the corrected CSV file.

One of the problems I have is that whenever I use the comma as FS the output for column 5 is the following

cat Test.csv | awk 'BEGIN { FS = "," } {print $5 }'
notes
this user\

this user is Jo
This note is actually very long\
Not much of a note really

It stops in the middle of the entry because it sees the comma but what I am trying to achieve is to produce the full entry for column 5 like this:

this user\, is the first in this file
This note is actually very long\, but really doesn't say anything very useful

I have to probably escape somehow the FS in the text but so far no joy with completing this task. Also can you kindly help out for the rest of the requirements.
I really appreciate your help in advance.

Ivan

Why Vsftp Can Do It, But Openssh Sftp Cannot ? (chroot)

Dear all,

This is long story cut short, with vsftp, if i set this parameters in the vsftp.conf file below

Code:
local_enable=YES
chroot_local_users=YES

I am able to login to the ftp account, see and list my home/user directory, and if i do a cd / or cd .. , i will still be chroot to my /home/user directory.

without, the need to chmod or or chown anything to my /home/user directory

=============================================

With openSSH, internal_sftp, even though I have set the sshd_conf to

Code:
Match user alankoh
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
ChrootDirectory /home/%u

I will need to change owner my /home/user directory to have root becomes it owner.
============================================

Q1) why this difference ? How does vsftp chroot without changing the /home/user folder ownership ?

Q2) i realize that openssh ChrootDirectory parameter causes my default login directory to be set as that of the parameter.
(e.g. if i set to "/whatever/xyz", i will be brought to that /whatever/xyz everytime i login to the sftp instead of my /home/user folder.

Why ? I thought that ChrootDirectory is just a security measure to specify the directory to go to in case the user cd to root (e.g. cd /), else not, i should still go to my /home/user folder everytime i login to sftp.

Regards,
Noob

(solved) User Has Not A Directory

Hi. When I ran #useradd -m -s /bin/bash -G áudio,lp,video, wheel,scanner -U user
#passwd user

I forgot to have the /home mounted (shame on me)

so now there is not a /home/user (directory) so user cannot start the X

how can I fix it?

thank you!

How To Copy File From Remote Host To Local Host Then Delete From Remote Host

I have an expect script to SSH to a remote host and obtain some user inputs and information about the server/network configuration. The responses are saved in a text file that I then need to copy to my local host so that I can read the lines into variables for use in the parent shell script.

Is there a way to do this without needing to enter the username and password for the local host to use function scp? I have tried the following in my expect script to no avail:
Code:
spawn scp $usr@$host:$flnm .
expect {
	-re "(.*)assword:" { 
		send -s "$pswd\r"
	}
}

I have also tried to directly scp the file and enter the username and password to try to debug the issue, and that doesn't work either:
Code:
spawn scp file.txt user@host:file.txt
expect {
	-re "(.*)assword:" {
		send -s "password\r"
	}
	"you sure you want to continue connecting" {
		send -s "yes\r"
		exp_continue
	}
}

In both scenarios I have used exp_internal 1, and there are no errors. But I do not end up with the file on my local host.

Following the copy, I would like to delete the file from the remote host. Any suggestions on how to accomplish this?

Cannot Login As A Different User Than The One Created At Installation Time

I have created a new user with "useradd" than changed the password with "passwd" (logged in as an administrator). After that I tried to login as the new user but couldn't. Error message was: "call to lnusertemp failed (temporary directories full?). Check your installation".

I currently use Debian 8.

I checked the home directory and couldn't find a new created folder for the new user (wasn't supposed to be done automatically by useradd?) and I checked the etc/password and there was the new user name inside it though.

What should I do? I really need to have more than one user on this computer...

Urgent!! File Transfer From Windows To Linux Server Using Ftp

Dear All

I need your help.
I want to get a file from windows server using ftp.
Below is the script I have created but the connection is not established:

#!/bin/sh

lcd "directory in linux server"
USER="username of windows server"
PASS="password"

ftp -n "ip of windows server" <<EOF
user $USER $PASS

cd "C:\Users... directory in windows server where file is located"
bin
get test1234.txt

bye

EOF

I hope somebody can help me!
BR,

A Kernel Thread Shares The Open Files From A User Thread

Hi all,

In my work, I'd like to spawn separate kernel threads (tasks) to execute syscall asynchronously. Specifically, a user thread issues a syscall, goes into kernel, save the syscall number and arguments somewhere in the kernel address space, but does not execute the syscall. A kernel thread which is different from the user thread, will fetch the syscall number and arguments to execute the syscall on behalf of the user thread.
But for file operations such as read, the kernel thread is not aware of the open files of the user threads. For example, if the user thread opens a file and get a file descriptor, then it issue a read() syscall. The kernel thread cannot execute the read() on behalf of the user thread by just using the file descriptor. Thus I need some way to allow the kernel thread share the open files information with the user thread, such that the kernel thread will have the context of the open file to execute read(). I tried to pass the files_struct of the user thread's task_struct to the kernel thread, but it didn't help, read() returns a EFAULT error.
Can anyone give me some suggestions on how to make a kernel thread share the open files with a user thread? Or more straightforward how to execute the read() syscall in the example above in kernel thread? Thank you very much!

--Louis

Why Should I Always Use Chmod When Not As A Root User

System Info:

I have normal user in CentOS 7 whose name is "mostafa" (the name of the account).

I naturally have another user called root with all privileges. User "mostafa" is put into sudoers file, too.

The OS is installed in VmWare, so the system is all mine.

Problem:

Now I create a file with touch file.sh and put a command in it, but when I want to run it with Code:
sudo ./file.sh

, an error is shown that the command Code:
./file.sh

does not exist. But if I Code:
 sudo chmod 777 ./file.sh

then it gets run. My question is that, why should I use Code:
chmod 777

when I myself have created the file, and I am in sudoers.

Can anyone explain me why shuold I still use Code:
sudo chmod 777

when the creator of the file is me.