#StackBounty: #python #c #python-3.x #ssh #paramiko Is there a method of executing a command then continue the program without command …

Bounty: 100

Hi I am trying to create a function which remotely executes my packet sniffing script on my raspberry pi using paramiko and ssh.

def startPacketReceiver():
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(AutoAddPolicy())
    ssh.connect(RECV_IP_ADDRESS, username="pi", password="raspberry")
    ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command("sudo gcc Code/test.c && sudo ./a.out")
    print("Done")

The test.c file is the packet sniffing script. It will only terminate with a CTRL-C (or equivalent method). It does not terminate naturally/eventually.

I want to be able to start the receiver and then quit the receiver e.g:

startPacketReceiver()
...
stopPacketReceiver()

Currently when I run the python script I never get the "Done" print message, meaning that the program is hung on the exec_command and will not continue until it is terminated.

Additional Info

The test.c file loops infinitely, essentially:

while(1)
{
    saddr_size = sizeof saddr;
    //Receive a packet
    data_size = recvfrom(sock_raw , buffer , 65536 , 0 , &saddr , (socklen_t*)&saddr_size);
    //fprintf(stderr,"%d",data_size);
    if(data_size <0 )
    {
        fprintf(stderr,"Failed to get packetn");
        printf("Recvfrom error , failed to get packetsn");
        return 1;
    }
    //Now process the packet
    ProcessPacket(buffer , data_size);
}

and so to stop it you must CTRL-C it.


Get this bounty!!!

#StackBounty: #ssh #mount #gvfs Unmount gvfs fileserver which does not show up in 'gvfs-mount -l'

Bounty: 50

I am working on a remote server that runs CentOS 7.4.1708. On this server, I managed to mount a fileserver, which is in the same network, with the following commands that I found somewhere on the internet:

export $(dbus-launch)
gvfs-mount smb://xxx.xxx.xxx.xxx/abc/

Now I was able to access the files at

/run/user/100*/gvfs/smb-share:server=xxx.xxx.xxx.xxx/,share=abc/

Once I finished moving files etc., I usually unmounted the server:

gvfs-mount -u smb://xxx.xxx.xxx.xxx/abc/

Now the problem is, that I forgot unmounting and just closed the ssh connection to the CentOS server. Once I logged in again, I could still access the fileserver at /run/user/100* and that directory still showed me as the owner. However, gvfs-mount -l does not show the fileserver anymore and trying to unmount it results in the following error message

Error finding enclosing mount: Containing mount does not exist

Edit: Remounting of the fileserver does not work, the gvfs-mount job does not finish within 10 minutes and seems to do nothing.

How can I unmount the fileserver now? (I have no sudo rights)


Get this bounty!!!

#StackBounty: #ssh #mount #gvfs Unmount gvfs fileserver which does not show up in 'gvfs-mount -l'

Bounty: 50

I am working on a remote server that runs CentOS 7.4.1708. On this server, I managed to mount a fileserver, which is in the same network, with the following commands that I found somewhere on the internet:

export $(dbus-launch)
gvfs-mount smb://xxx.xxx.xxx.xxx/abc/

Now I was able to access the files at

/run/user/100*/gvfs/smb-share:server=xxx.xxx.xxx.xxx/,share=abc/

Once I finished moving files etc., I usually unmounted the server:

gvfs-mount -u smb://xxx.xxx.xxx.xxx/abc/

Now the problem is, that I forgot unmounting and just closed the ssh connection to the CentOS server. Once I logged in again, I could still access the fileserver at /run/user/100* and that directory still showed me as the owner. However, gvfs-mount -l does not show the fileserver anymore and trying to unmount it results in the following error message

Error finding enclosing mount: Containing mount does not exist

Edit: Remounting of the fileserver does not work, the gvfs-mount job does not finish within 10 minutes and seems to do nothing.

How can I unmount the fileserver now? (I have no sudo rights)


Get this bounty!!!

#StackBounty: #ssh #mount #gvfs Unmount gvfs fileserver which does not show up in 'gvfs-mount -l'

Bounty: 50

I am working on a remote server that runs CentOS 7.4.1708. On this server, I managed to mount a fileserver, which is in the same network, with the following commands that I found somewhere on the internet:

export $(dbus-launch)
gvfs-mount smb://xxx.xxx.xxx.xxx/abc/

Now I was able to access the files at

/run/user/100*/gvfs/smb-share:server=xxx.xxx.xxx.xxx/,share=abc/

Once I finished moving files etc., I usually unmounted the server:

gvfs-mount -u smb://xxx.xxx.xxx.xxx/abc/

Now the problem is, that I forgot unmounting and just closed the ssh connection to the CentOS server. Once I logged in again, I could still access the fileserver at /run/user/100* and that directory still showed me as the owner. However, gvfs-mount -l does not show the fileserver anymore and trying to unmount it results in the following error message

Error finding enclosing mount: Containing mount does not exist

Edit: Remounting of the fileserver does not work, the gvfs-mount job does not finish within 10 minutes and seems to do nothing.

How can I unmount the fileserver now? (I have no sudo rights)


Get this bounty!!!

#StackBounty: #ssh #mount #gvfs Unmount gvfs fileserver which does not show up in 'gvfs-mount -l'

Bounty: 50

I am working on a remote server that runs CentOS 7.4.1708. On this server, I managed to mount a fileserver, which is in the same network, with the following commands that I found somewhere on the internet:

export $(dbus-launch)
gvfs-mount smb://xxx.xxx.xxx.xxx/abc/

Now I was able to access the files at

/run/user/100*/gvfs/smb-share:server=xxx.xxx.xxx.xxx/,share=abc/

Once I finished moving files etc., I usually unmounted the server:

gvfs-mount -u smb://xxx.xxx.xxx.xxx/abc/

Now the problem is, that I forgot unmounting and just closed the ssh connection to the CentOS server. Once I logged in again, I could still access the fileserver at /run/user/100* and that directory still showed me as the owner. However, gvfs-mount -l does not show the fileserver anymore and trying to unmount it results in the following error message

Error finding enclosing mount: Containing mount does not exist

Edit: Remounting of the fileserver does not work, the gvfs-mount job does not finish within 10 minutes and seems to do nothing.

How can I unmount the fileserver now? (I have no sudo rights)


Get this bounty!!!

#StackBounty: #ssh #mount #gvfs Unmount gvfs fileserver which does not show up in 'gvfs-mount -l'

Bounty: 50

I am working on a remote server that runs CentOS 7.4.1708. On this server, I managed to mount a fileserver, which is in the same network, with the following commands that I found somewhere on the internet:

export $(dbus-launch)
gvfs-mount smb://xxx.xxx.xxx.xxx/abc/

Now I was able to access the files at

/run/user/100*/gvfs/smb-share:server=xxx.xxx.xxx.xxx/,share=abc/

Once I finished moving files etc., I usually unmounted the server:

gvfs-mount -u smb://xxx.xxx.xxx.xxx/abc/

Now the problem is, that I forgot unmounting and just closed the ssh connection to the CentOS server. Once I logged in again, I could still access the fileserver at /run/user/100* and that directory still showed me as the owner. However, gvfs-mount -l does not show the fileserver anymore and trying to unmount it results in the following error message

Error finding enclosing mount: Containing mount does not exist

Edit: Remounting of the fileserver does not work, the gvfs-mount job does not finish within 10 minutes and seems to do nothing.

How can I unmount the fileserver now? (I have no sudo rights)


Get this bounty!!!

#StackBounty: #ssh #mount #gvfs Unmount gvfs fileserver which does not show up in 'gvfs-mount -l'

Bounty: 50

I am working on a remote server that runs CentOS 7.4.1708. On this server, I managed to mount a fileserver, which is in the same network, with the following commands that I found somewhere on the internet:

export $(dbus-launch)
gvfs-mount smb://xxx.xxx.xxx.xxx/abc/

Now I was able to access the files at

/run/user/100*/gvfs/smb-share:server=xxx.xxx.xxx.xxx/,share=abc/

Once I finished moving files etc., I usually unmounted the server:

gvfs-mount -u smb://xxx.xxx.xxx.xxx/abc/

Now the problem is, that I forgot unmounting and just closed the ssh connection to the CentOS server. Once I logged in again, I could still access the fileserver at /run/user/100* and that directory still showed me as the owner. However, gvfs-mount -l does not show the fileserver anymore and trying to unmount it results in the following error message

Error finding enclosing mount: Containing mount does not exist

Edit: Remounting of the fileserver does not work, the gvfs-mount job does not finish within 10 minutes and seems to do nothing.

How can I unmount the fileserver now? (I have no sudo rights)


Get this bounty!!!

#StackBounty: #ssh #mount #gvfs Unmount gvfs fileserver which does not show up in 'gvfs-mount -l'

Bounty: 50

I am working on a remote server that runs CentOS 7.4.1708. On this server, I managed to mount a fileserver, which is in the same network, with the following commands that I found somewhere on the internet:

export $(dbus-launch)
gvfs-mount smb://xxx.xxx.xxx.xxx/abc/

Now I was able to access the files at

/run/user/100*/gvfs/smb-share:server=xxx.xxx.xxx.xxx/,share=abc/

Once I finished moving files etc., I usually unmounted the server:

gvfs-mount -u smb://xxx.xxx.xxx.xxx/abc/

Now the problem is, that I forgot unmounting and just closed the ssh connection to the CentOS server. Once I logged in again, I could still access the fileserver at /run/user/100* and that directory still showed me as the owner. However, gvfs-mount -l does not show the fileserver anymore and trying to unmount it results in the following error message

Error finding enclosing mount: Containing mount does not exist

Edit: Remounting of the fileserver does not work, the gvfs-mount job does not finish within 10 minutes and seems to do nothing.

How can I unmount the fileserver now? (I have no sudo rights)


Get this bounty!!!

#StackBounty: #ssh #mount #gvfs Unmount gvfs fileserver which does not show up in 'gvfs-mount -l'

Bounty: 50

I am working on a remote server that runs CentOS 7.4.1708. On this server, I managed to mount a fileserver, which is in the same network, with the following commands that I found somewhere on the internet:

export $(dbus-launch)
gvfs-mount smb://xxx.xxx.xxx.xxx/abc/

Now I was able to access the files at

/run/user/100*/gvfs/smb-share:server=xxx.xxx.xxx.xxx/,share=abc/

Once I finished moving files etc., I usually unmounted the server:

gvfs-mount -u smb://xxx.xxx.xxx.xxx/abc/

Now the problem is, that I forgot unmounting and just closed the ssh connection to the CentOS server. Once I logged in again, I could still access the fileserver at /run/user/100* and that directory still showed me as the owner. However, gvfs-mount -l does not show the fileserver anymore and trying to unmount it results in the following error message

Error finding enclosing mount: Containing mount does not exist

Edit: Remounting of the fileserver does not work, the gvfs-mount job does not finish within 10 minutes and seems to do nothing.

How can I unmount the fileserver now? (I have no sudo rights)


Get this bounty!!!